fn u8_max_allocation_is_correct() {
        let mut shortest_disallowed_vec = vec![0u8; MAX_U8_ALLOCATION + 1];
        let shortest_disallowed_serialized = shortest_disallowed_vec
            .zcash_serialize_to_vec()
            .expect("Serialization to vec must succeed");

        // Confirm that shortest_disallowed_vec is only one item larger than the limit
        assert_eq!((shortest_disallowed_vec.len() - 1), MAX_U8_ALLOCATION);
        // Confirm that shortest_disallowed_vec is too large to be included in a valid zcash message
        assert!(shortest_disallowed_serialized.len() > MAX_PROTOCOL_MESSAGE_LEN);

        // Create largest_allowed_vec by removing one element from smallest_disallowed_vec without copying (for efficiency)
        shortest_disallowed_vec.pop();
        let longest_allowed_vec = shortest_disallowed_vec;
        let longest_allowed_serialized = longest_allowed_vec
            .zcash_serialize_to_vec()
            .expect("serialization to vec must succed");

        // Check that our largest_allowed_vec contains the maximum number of items
        assert_eq!(longest_allowed_vec.len(), MAX_U8_ALLOCATION);
        // Check that our largest_allowed_vec is the size of a maximal protocol message
        assert_eq!(longest_allowed_serialized.len(), MAX_PROTOCOL_MESSAGE_LEN);
    }
/// Verify that...
/// 1. The smallest disallowed `Vec<u8>` is too big to include in a Zcash Wire Protocol message
/// 2. The largest allowed `Vec<u8>`is exactly the size of a maximal Zcash Wire Protocol message
Verify that
1. The smallest disallowed `Vec` is too big to include in a Zcash Wire Protocol message
2. The largest allowed `Vec`is exactly the size of a maximal Zcash Wire Protocol message
Verify that 1 . The smallest disallowed ` Vec ` is too big to include in a Zcash Wire Protocol message 2 . The largest allowed ` Vec ` is exactly the size of a maximal Zcash Wire Protocol message
fn u8_max_allocation_is_correct() {
        let mut shortest_disallowed_vec = vec![0u8; MAX_U8_ALLOCATION + 1];
        let shortest_disallowed_serialized = shortest_disallowed_vec
            .zcash_serialize_to_vec()
            .expect("Serialization to vec must succeed");
        // Confirm that shortest_disallowed_vec is only one item larger than the limit
        assert_eq!((shortest_disallowed_vec.len() - 1), MAX_U8_ALLOCATION);
        // Confirm that shortest_disallowed_vec is too large to be included in a valid zcash message
        assert!(shortest_disallowed_serialized.len() > MAX_PROTOCOL_MESSAGE_LEN);
        // Create largest_allowed_vec by removing one element from smallest_disallowed_vec without copying (for efficiency)
        shortest_disallowed_vec.pop();
        let longest_allowed_vec = shortest_disallowed_vec;
        let longest_allowed_serialized = longest_allowed_vec
            .zcash_serialize_to_vec()
            .expect("serialization to vec must succed");
        // Check that our largest_allowed_vec contains the maximum number of items
        assert_eq!(longest_allowed_vec.len(), MAX_U8_ALLOCATION);
        // Check that our largest_allowed_vec is the size of a maximal protocol message
        assert_eq!(longest_allowed_serialized.len(), MAX_PROTOCOL_MESSAGE_LEN);
    }
fn u8_max_allocation_is_correct ( ) { let mut shortest_disallowed_vec = vec ! [ 0u8 MAX_U8_ALLOCATION 1 ] ; let shortest_disallowed_serialized = shortest_disallowed_vec . zcash_serialize_to_vec ( ) . expect ( " " ) ; // Confirm that shortest_disallowed_vec is only one item larger than the limit assert_eq ! ( ( shortest_disallowed_vec len ( ) 1 ) MAX_U8_ALLOCATION ) ; // Confirm that shortest_disallowed_vec is too large to be included in a valid zcash message assert ! ( shortest_disallowed_serialized len ( ) MAX_PROTOCOL_MESSAGE_LEN ) ; // Create largest_allowed_vec by removing one element from smallest_disallowed_vec without copying (for efficiency) shortest_disallowed_vec . pop ( ) ; let longest_allowed_vec = shortest_disallowed_vec ; let longest_allowed_serialized = longest_allowed_vec . zcash_serialize_to_vec ( ) . expect ( " " ) ; // Check that our largest_allowed_vec contains the maximum number of items assert_eq ! ( longest_allowed_vec len ( ) MAX_U8_ALLOCATION ) ; // Check that our largest_allowed_vec is the size of a maximal protocol message assert_eq ! ( longest_allowed_serialized len ( ) MAX_PROTOCOL_MESSAGE_LEN ) ; }
Verify that...
1.
Verify that ... 1 .