fn validate_tape_artifacts<S>(
        &self,
        pool_reader: &PoolReader<'_>,
        tapes: Box<dyn Iterator<Item = Signed<RandomTapeContent, S>>>,
    ) -> ChangeSet
    where
        Signed<RandomTapeContent, S>: SignatureVerify + ConsensusMessageHashable + Clone,
    {
        tapes
            .filter_map(|tape| {
                let height = tape.height();
                if height == Height::from(0) {
                    // tape of height 0 is considered invalid
                    Some(ChangeAction::HandleInvalid(
                        tape.into_message(),
                        "Tape at height 0".to_string(),
                    ))
                } else if pool_reader.get_random_tape(height).is_some() {
                    // Remove if we already have a validated tape at this height
                    Some(ChangeAction::RemoveFromUnvalidated(tape.into_message()))
                } else {
                    let verification = self.verify_signature(pool_reader, &tape);
                    self.compute_action_from_sig_verification(verification, tape.into_message())
                }
            })
            .collect()
    }
/// Check the validity of a Vec of RandomTape artifacts. This function
/// assumes that the received artifacts are already filtered by their height
/// and checks whether each RandomTapeContent
/// * has non-zero height,
/// * is signed by member(s) of the threshold group,
/// * has a valid signature.
Check the validity of a Vec of RandomTape artifacts. This function
assumes that the received artifacts are already filtered by their height
and checks whether each RandomTapeContent
has non-zero height,
is signed by member(s) of the threshold group,
has a valid signature.
Check the validity of a Vec of RandomTape artifacts . This function assumes that the received artifacts are already filtered by their height and checks whether each RandomTapeContent has non - zero height is signed by member ( s ) of the threshold group has a valid signature .
fn validate_tape_artifacts<S>(
        &self,
        pool_reader: &PoolReader<'_>,
        tapes: Box<dyn Iterator<Item = Signed<RandomTapeContent, S>>>,
    ) -> ChangeSet
    where
        Signed<RandomTapeContent, S>: SignatureVerify + ConsensusMessageHashable + Clone,
    {
        tapes
            .filter_map(|tape| {
                let height = tape.height();
                if height == Height::from(0) {
                    // tape of height 0 is considered invalid
                    Some(ChangeAction::HandleInvalid(
                        tape.into_message(),
                        "Tape at height 0".to_string(),
                    ))
                } else if pool_reader.get_random_tape(height).is_some() {
                    // Remove if we already have a validated tape at this height
                    Some(ChangeAction::RemoveFromUnvalidated(tape.into_message()))
                } else {
                    let verification = self.verify_signature(pool_reader, &tape);
                    self.compute_action_from_sig_verification(verification, tape.into_message())
                }
            })
            .collect()
    }
fn validate_tape_artifacts < S > ( & self , pool_reader : & PoolReader < ' _ > , tapes : Box < dyn Iterator < Item = Signed < RandomTapeContent , S > > > , ) -> ChangeSet where Signed < RandomTapeContent , S > : SignatureVerify + ConsensusMessageHashable + Clone , { tapes . filter_map ( | tape | { let height = tape . height ( ) ; if height == Height :: from ( 0 ) { // tape of height 0 is considered invalid Some ( ChangeAction :: HandleInvalid ( tape . into_message ( ) , " " . to_string ( ) , ) ) } else if pool_reader . get_random_tape ( height ) . is_some ( ) { // Remove if we already have a validated tape at this height Some ( ChangeAction :: RemoveFromUnvalidated ( tape . into_message ( ) ) ) } else { let verification = self . verify_signature ( pool_reader , & tape ) ; self . compute_action_from_sig_verification ( verification , tape . into_message ( ) ) } } ) . collect ( ) }
Check the validity of a Vec of RandomTape artifacts.
Check the validity of a Vec of RandomTape artifacts .
&self
pool_reader
&PoolReader<'_>
tapes
Box<dyn Iterator<Item = Signed<RandomTapeContent, S>>>
&self
pool_reader
&PoolReader<'_>
tapes
Box<dyn Iterator<Item = Signed<RandomTapeContent, S>>>