Hashable

Trait Hashable 

Source
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§

Source

fn calculate_msg_hash( &self, chain_id: &str, height: i64, round: i32, ) -> Result<Vec<u8>, Error>

Generate hash of data to sign

Implementations on Foreign Types§

Source§

impl Hashable for ValidatorSet

Source§

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.

Implementors§

Source§

impl<T: SignBytes> Hashable for T