pub trait Hashable {
// Required method
fn calculate_msg_hash(
&self,
chain_id: &str,
height: i64,
round: i32,
) -> Result<Vec<u8>, Error>;
}Expand description
Calculate hash (sha256) of the data, using algorithms used by Tenderdash.
Required Methods§
Implementations on Foreign Types§
Source§impl Hashable for ValidatorSet
impl Hashable for ValidatorSet
Source§fn calculate_msg_hash(
&self,
_chain_id: &str,
_height: i64,
_round: i32,
) -> Result<Vec<u8>, Error>
fn calculate_msg_hash( &self, _chain_id: &str, _height: i64, _round: i32, ) -> Result<Vec<u8>, Error>
Calculate hash of validator set.
Calculates hash of validator set that is used in block header Header.validators_hash and Header.next_validators_hash fields.
§Tenderdash implementation
Original Tenderdash implementation:
bzs := make([][]byte, 2)
bzs[0] = vals.ThresholdPublicKey.Bytes()
bzs[1] = vals.QuorumHash
return merkle.HashFromByteSlices(bzs)§Arguments
All arguments are ignored.
§Returns
Returns hash of validator set.