pub fn verify(&self, validator: &ValidatorVerifier) -> failure::Result<()> {
        ensure!(
            self.ledger_info.consensus_data_hash() == self.vote_data.hash(),
            "Vote's hash mismatch with LedgerInfo"
        );
        self.signature()
            .verify(validator, self.author(), self.ledger_info.hash())
            .with_context(|e| format!("Fail to verify VoteMsg: {:?}", e))?;
        if let Some(round_signature) = &self.round_signature {
            round_signature
                .verify(
                    validator,
                    self.author(),
                    common::round_hash(self.vote_data().proposed().round()),
                )
                .with_context(|e| format!("Fail to verify VoteMsg: {:?}", e))?;
        }
        Ok(())
    }
/// Verifies that the consensus data hash of LedgerInfo corresponds to the vote info,
/// and then verifies the signature.
Verifies that the consensus data hash of LedgerInfo corresponds to the vote info,
and then verifies the signature.
Verifies that the consensus data hash of LedgerInfo corresponds to the vote info and then verifies the signature .
pub fn verify(&self, validator: &ValidatorVerifier) -> failure::Result<()> {
        ensure!(
            self.ledger_info.consensus_data_hash() == self.vote_data.hash(),
            "Vote's hash mismatch with LedgerInfo"
        );
        self.signature()
            .verify(validator, self.author(), self.ledger_info.hash())
            .with_context(|e| format!("Fail to verify VoteMsg: {:?}", e))?;
        if let Some(round_signature) = &self.round_signature {
            round_signature
                .verify(
                    validator,
                    self.author(),
                    common::round_hash(self.vote_data().proposed().round()),
                )
                .with_context(|e| format!("Fail to verify VoteMsg: {:?}", e))?;
        }
        Ok(())
    }
pub fn verify ( & self , validator : & ValidatorVerifier ) -> failure :: Result < ( ) > { ensure ! ( self ledger_info consensus_data_hash ( ) self vote_data hash ( ) " " ) ; self . signature ( ) . verify ( validator , self . author ( ) , self . ledger_info . hash ( ) ) . with_context ( | e | format ! ( " " e ) ) ? ; if let Some ( round_signature ) = & self . round_signature { round_signature . verify ( validator , self . author ( ) , common :: round_hash ( self . vote_data ( ) . proposed ( ) . round ( ) ) , ) . with_context ( | e | format ! ( " " e ) ) ? ; } Ok ( ( ) ) }
Verifies that the consensus data hash of LedgerInfo corresponds to the vote info,
and then verifies the signature.
Verifies that the consensus data hash of LedgerInfo corresponds to the vote info and then verifies the signature .
&self
validator
&ValidatorVerifier
&self
validator
&ValidatorVerifier