mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-24 18:21:38 +00:00
Add hash to ConsensusParams
This commit is contained in:
committed by
Ethan Buchman
parent
030fd00232
commit
a0b2d77bef
@ -2,6 +2,8 @@ package types
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/tendermint/tmlibs/merkle"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -85,3 +87,16 @@ func (params *ConsensusParams) Validate() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Hash returns a merkle hash of the parameters to store
|
||||
// in the block header
|
||||
func (params *ConsensusParams) Hash() []byte {
|
||||
return merkle.SimpleHashFromMap(map[string]interface{}{
|
||||
"block_gossip_part_size_bytes": params.BlockGossipParams.BlockPartSizeBytes,
|
||||
"block_size_max_bytes": params.BlockSizeParams.MaxBytes,
|
||||
"block_size_max_gas": params.BlockSizeParams.MaxGas,
|
||||
"block_size_max_txs": params.BlockSizeParams.MaxTxs,
|
||||
"tx_size_max_bytes": params.TxSizeParams.MaxBytes,
|
||||
"tx_size_max_gas": params.TxSizeParams.MaxGas,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user