From 2eb992f792d703cf0fc916a5bc3f04541f398e58 Mon Sep 17 00:00:00 2001 From: xenowits Date: Tue, 31 May 2022 08:24:49 +0530 Subject: [PATCH] cleanup --- cluster/lock.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cluster/lock.go b/cluster/lock.go index c8d4d34d0..9f51fad68 100644 --- a/cluster/lock.go +++ b/cluster/lock.go @@ -16,6 +16,7 @@ package cluster import ( + "bytes" "encoding/json" ssz "github.com/ferranbt/fastssz" @@ -107,14 +108,14 @@ func (l *Lock) UnmarshalJSON(data []byte) error { SignatureAggregate: lockFmt.SignatureAggregate, } - // hash, err := lock.HashTreeRoot() - // if err != nil { - // return errors.Wrap(err, "hash lock") - // } - // - // if !bytes.Equal(lockFmt.LockHash, hash[:]) { - // return errors.New("invalid lock hash") - // } + hash, err := lock.HashTreeRoot() + if err != nil { + return errors.Wrap(err, "hash lock") + } + + if !bytes.Equal(lockFmt.LockHash, hash[:]) { + return errors.New("invalid lock hash") + } *l = lock