/// Verifies that all instances output the same sequence of batches.
Verifies that all instances output the same sequence of batches.
Verifies that all instances output the same sequence of batches .
fn verify_output_sequence<A>(network: &VirtualNet<UsizeHoneyBadger, A>)
where
    A: Adversary<UsizeHoneyBadger>,
{
    let mut expected: Option<BTreeMap<u64, &_>> = None;
    for node in network.correct_nodes() {
        assert!(!node.outputs().is_empty());
        let outputs: BTreeMap<u64, &BTreeMap<NodeId, Vec<usize>>> = node
            .outputs()
            .iter()
            .map(|batch| (batch.epoch, &batch.contributions))
            .collect();
        if expected.is_none() {
            expected = Some(outputs);
        } else if let Some(expected) = &expected {
            assert_eq!(expected, &outputs);
        }
    }
}
fn verify_output_sequence < A > ( network : & VirtualNet < UsizeHoneyBadger , A > ) where A : Adversary < UsizeHoneyBadger > , { let mut expected : Option < BTreeMap < u64 , & _ > > = None ; for node in network . correct_nodes ( ) { assert ! ( node outputs ( ) is_empty ( ) ) ; let outputs : BTreeMap < u64 , & BTreeMap < NodeId , Vec < usize > > > = node . outputs ( ) . iter ( ) . map ( | batch | ( batch . epoch , & batch . contributions ) ) . collect ( ) ; if expected . is_none ( ) { expected = Some ( outputs ) ; } else if let Some ( expected ) = & expected { assert_eq ! ( expected outputs ) ; } } }
Verifies that all instances output the same sequence of batches.
Verifies that all instances output the same sequence of batches .
network
&VirtualNet<UsizeHoneyBadger, A>