From 1eaf8ada003e1205a3957510334eafcac6e625f1 Mon Sep 17 00:00:00 2001 From: rupam-04 Date: Fri, 5 Jul 2024 02:44:56 +0530 Subject: [PATCH] replace ``!=`` with ``!reflect.DeepEqual`` --- beacon-chain/rpc/eth/light-client/helpers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index 254d11543e35..7aef38538d69 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -3,6 +3,7 @@ package lightclient import ( "context" "fmt" + "reflect" "strconv" "github.com/ethereum/go-ethereum/common/hexutil" @@ -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 {