Skip to content

Commit

Permalink
Hash change
Browse files Browse the repository at this point in the history
  • Loading branch information
goran-ethernal committed Nov 24, 2022
1 parent dfbe820 commit 2df1a11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions consensus/polybft/extra.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,12 @@ func (c *CheckpointData) Hash(chainID uint64, blockNumber uint64, blockHash type
checkpointMap := map[string]interface{}{
"chainId": new(big.Int).SetUint64(chainID),
"blockNumber": new(big.Int).SetUint64(blockNumber),
"blockHash": blockHash.Bytes(),
"blockHash": blockHash,
"blockRound": new(big.Int).SetUint64(c.BlockRound),
"epochNumber": new(big.Int).SetUint64(c.EpochNumber),
"currentValidatorsHash": c.CurrentValidatorsHash.Bytes(),
"nextValidatorsHash": c.NextValidatorsHash.Bytes(),
"eventRoot": c.EventRoot.Bytes(),
"currentValidatorsHash": c.CurrentValidatorsHash,
"nextValidatorsHash": c.NextValidatorsHash,
"eventRoot": c.EventRoot,
}

abiEncoded, err := checkpointDataABIType.Encode(checkpointMap)
Expand Down
4 changes: 2 additions & 2 deletions consensus/polybft/validator_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/umbracle/fastrlp"
)

var accountSetABIType = abi.MustNewType(`tuple(address _address, uint256[4] blsKey, uint256 votingPower)[]`)
var accountSetABIType = abi.MustNewType(`tuple(tuple(address _address, uint256[4] blsKey, uint256 votingPower)[])`)

// ValidatorMetadata represents a validator metadata (its public identity)
type ValidatorMetadata struct {
Expand Down Expand Up @@ -179,7 +179,7 @@ func (as AccountSet) Copy() AccountSet {

// Hash returns hash value of the AccountSet
func (as AccountSet) Hash() (types.Hash, error) {
abiEncoded, err := accountSetABIType.Encode(as.AsGenericMaps())
abiEncoded, err := accountSetABIType.Encode([]interface{}{as.AsGenericMaps()})
if err != nil {
return types.ZeroHash, err
}
Expand Down

0 comments on commit 2df1a11

Please sign in to comment.