Skip to content

Commit

Permalink
replace != with !reflect.DeepEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
rupam-04 committed Jul 6, 2024
1 parent 382e5c1 commit 1829feb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions beacon-chain/rpc/eth/light-client/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package lightclient
import (
"context"
"fmt"
"reflect"
"strconv"

"github.com/ethereum/go-ethereum/common/hexutil"
Expand Down Expand Up @@ -319,12 +320,12 @@ func newLightClientUpdateToJSON(input *v2.LightClientUpdate) *structs.LightClien

func isSyncCommitteeUpdate(update *ethpbv2.LightClientUpdate) bool {
nextSyncCommitteeBranch := make([][]byte, fieldparams.NextSyncCommitteeBranchDepth)
return update.NextSyncCommitteeBranch != nextSyncCommitteeBranch
return !reflect.DeepEqual(update.NextSyncCommitteeBranch, nextSyncCommitteeBranch)
}

func isFinalityUpdate(update *ethpbv2.LightClientUpdate) bool {
finalityBranch := make([][]byte, finalityBranchNumOfLeaves)
return update.FinalityBranch != finalityBranch
return !reflect.DeepEqual(update.FinalityBranch, finalityBranch)
}

func isBetterUpdate(newUpdate, oldUpdate *ethpbv2.LightClientUpdate) bool {
Expand Down

0 comments on commit 1829feb

Please sign in to comment.