diff --git a/consensus/polybft/extra.go b/consensus/polybft/extra.go index 4232341847..1a5ba5af89 100644 --- a/consensus/polybft/extra.go +++ b/consensus/polybft/extra.go @@ -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) diff --git a/consensus/polybft/validator_metadata.go b/consensus/polybft/validator_metadata.go index 2e8ec2f2ae..f806865af6 100644 --- a/consensus/polybft/validator_metadata.go +++ b/consensus/polybft/validator_metadata.go @@ -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 { @@ -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 }