Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
xenowits committed May 31, 2022
1 parent 0db62fe commit 2eb992f
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions cluster/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package cluster

import (
"bytes"
"encoding/json"

ssz "github.com/ferranbt/fastssz"
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 2eb992f

Please sign in to comment.