pub fn verify(
        &self,
        validator: &ValidatorVerifier<Ed25519PublicKey>,
    ) -> Result<(), PacemakerTimeoutCertificateVerificationError> {
        let mut min_round: Option<Round> = None;
        let mut unique_authors = HashSet::new();
        for timeout in &self.timeouts {
            if let Err(e) =
                validator.verify_signature(timeout.author(), timeout.digest(), timeout.signature())
            {
                return Err(SigVerifyError(timeout.author(), e));
            }
            unique_authors.insert(timeout.author());
            let timeout_round = timeout.round();
            min_round = Some(min_round.map_or(timeout_round, move |x| x.min(timeout_round)))
        }
        if unique_authors.len() < validator.quorum_size() {
            return Err(NoQuorum);
        }
        if min_round == Some(self.round) {
            Ok(())
        } else {
            Err(RoundMismatch {
                expected: min_round.unwrap_or(0),
            })
        }
    }
/// Verifies that timeouts in message actually certify the round
Verifies that timeouts in message actually certify the round
Verifies that timeouts in message actually certify the round
pub fn verify(
        &self,
        validator: &ValidatorVerifier<Ed25519PublicKey>,
    ) -> Result<(), PacemakerTimeoutCertificateVerificationError> {
        let mut min_round: Option<Round> = None;
        let mut unique_authors = HashSet::new();
        for timeout in &self.timeouts {
            if let Err(e) =
                validator.verify_signature(timeout.author(), timeout.digest(), timeout.signature())
            {
                return Err(SigVerifyError(timeout.author(), e));
            }
            unique_authors.insert(timeout.author());
            let timeout_round = timeout.round();
            min_round = Some(min_round.map_or(timeout_round, move |x| x.min(timeout_round)))
        }
        if unique_authors.len() < validator.quorum_size() {
            return Err(NoQuorum);
        }
        if min_round == Some(self.round) {
            Ok(())
        } else {
            Err(RoundMismatch {
                expected: min_round.unwrap_or(0),
            })
        }
    }
pub fn verify ( & self , validator : & ValidatorVerifier < Ed25519PublicKey > , ) -> Result < ( ) , PacemakerTimeoutCertificateVerificationError > { let mut min_round : Option < Round > = None ; let mut unique_authors = HashSet :: new ( ) ; for timeout in & self . timeouts { if let Err ( e ) = validator . verify_signature ( timeout . author ( ) , timeout . digest ( ) , timeout . signature ( ) ) { return Err ( SigVerifyError ( timeout . author ( ) , e ) ) ; } unique_authors . insert ( timeout . author ( ) ) ; let timeout_round = timeout . round ( ) ; min_round = Some ( min_round . map_or ( timeout_round , move | x | x . min ( timeout_round ) ) ) } if unique_authors . len ( ) < validator . quorum_size ( ) { return Err ( NoQuorum ) ; } if min_round == Some ( self . round ) { Ok ( ( ) ) } else { Err ( RoundMismatch { expected : min_round . unwrap_or ( 0 ) , } ) } }
Verifies that timeouts in message actually certify the round
Verifies that timeouts in message actually certify the round
&self
validator
&ValidatorVerifier<Ed25519PublicKey>
&self
validator
&ValidatorVerifier<Ed25519PublicKey>