// Tests that the messages from the pool match the messages that we inserted,
// namely:
// - That we get the same number of messages back.
// - That height is monotonically increasing (iterators are in order, for
//   height).
// - That the max and min match.
// - That all the messages are present in the original messages.
//
// Returns the min/max height found to use in later tests.
Tests that the messages from the pool match the messages that we inserted,
namely:
That we get the same number of messages back.
That height is monotonically increasing (iterators are in order, for
height).
That the max and min match.
That all the messages are present in the original messages.

Returns the min/max height found to use in later tests.
Tests that the messages from the pool match the messages that we inserted namely : That we get the same number of messages back . That height is monotonically increasing ( iterators are in order for height ) . That the max and min match . That all the messages are present in the original messages . Returns the min / max height found to use in later tests .
fn match_all_ops<T: ConsensusMessageHashable + Eq + std::fmt::Debug>(
    msgs_from_pool: &[T],
    original_ops: &[T],
    multiple_values: bool,
) -> (Height, Height) {
    let mut min_height = Height::from(1000 * 1000);
    let mut max_height = Height::from(0);
    let mut monotonic_height = Height::from(0);
    assert_eq!(msgs_from_pool.len(), original_ops.len());
    for msg in msgs_from_pool.iter() {
        let msg_height = msg.get_id().height;
        if msg_height < min_height {
            min_height = msg_height;
        }
        if msg_height > max_height {
            max_height = msg_height;
        }
        if multiple_values {
            assert!(monotonic_height <= msg_height);
        } else {
            assert!(monotonic_height < msg_height);
        }
        monotonic_height = msg_height;
        assert!(original_ops.contains(msg));
    }
    assert_eq!(min_height, original_ops[0].get_id().height);
    assert_eq!(
        max_height,
        original_ops[original_ops.len() - 1].get_id().height
    );
    (min_height, max_height)
}
fn match_all_ops < T : ConsensusMessageHashable + Eq + std :: fmt :: Debug > ( msgs_from_pool : & [ T ] , original_ops : & [ T ] , multiple_values : bool , ) -> ( Height , Height ) { let mut min_height = Height :: from ( 1000 * 1000 ) ; let mut max_height = Height :: from ( 0 ) ; let mut monotonic_height = Height :: from ( 0 ) ; assert_eq ! ( msgs_from_pool len ( ) original_ops len ( ) ) ; for msg in msgs_from_pool . iter ( ) { let msg_height = msg . get_id ( ) . height ; if msg_height < min_height { min_height = msg_height ; } if msg_height > max_height { max_height = msg_height ; } if multiple_values { assert ! ( monotonic_height msg_height ) ; } else { assert ! ( monotonic_height msg_height ) ; } monotonic_height = msg_height ; assert ! ( original_ops contains ( msg ) ) ; } assert_eq ! ( min_height original_ops [ 0 ] get_id ( ) height ) ; assert_eq ! ( max_height original_ops [ original_ops len ( ) 1 ] get_id ( ) height ) ; ( min_height , max_height ) }
Tests that the messages from the pool match the messages that we inserted,
namely:
 That we get the same number of messages back.
Tests that the messages from the pool match the messages that we inserted namely : That we get the same number of messages back .
msgs_from_pool
&[T]
original_ops
&[T]
multiple_values
bool