fn generate_vote_hash(&self) -> String {
        let data = format!(
            "{}:{}:{}:{}",
            self.salt,
            self.exchange_rate,
            self.denom.as_str(),
            self.validator.to_bech32("terravaloper"),
        );

        // Tendermint truncated sha256
        let digest = Sha256::digest(data.as_bytes());
        let mut bytes = [0u8; 20];
        bytes.copy_from_slice(&digest[..20]);

        // Should always succeed.
        String::from_utf8(hex::encode(bytes)).unwrap()
    }
/// Generate hex encoded truncated SHA-256 of vote. Needed to generate prevote
Generate hex encoded truncated SHA-256 of vote. Needed to generate prevote
Generate hex encoded truncated SHA - 256 of vote . Needed to generate prevote
fn generate_vote_hash(&self) -> String {
        let data = format!(
            "{}:{}:{}:{}",
            self.salt,
            self.exchange_rate,
            self.denom.as_str(),
            self.validator.to_bech32("terravaloper"),
        );
        // Tendermint truncated sha256
        let digest = Sha256::digest(data.as_bytes());
        let mut bytes = [0u8; 20];
        bytes.copy_from_slice(&digest[..20]);
        // Should always succeed.
        String::from_utf8(hex::encode(bytes)).unwrap()
    }
fn generate_vote_hash ( & self ) -> String { let data = format ! ( " " self salt self exchange_rate self denom as_str ( ) self validator to_bech32 ( " " ) ) ; // Tendermint truncated sha256 let digest = Sha256 :: digest ( data . as_bytes ( ) ) ; let mut bytes = [ 0u8 ; 20 ] ; bytes . copy_from_slice ( & digest [ .. 20 ] ) ; // Should always succeed. String :: from_utf8 ( hex :: encode ( bytes ) ) . unwrap ( ) }
Generate hex encoded truncated SHA-256 of vote.
Generate hex encoded truncated SHA - 256 of vote .
&self
&self