From d9a4dbd91295d4e1d6b670381ab2a7e6b83c876d Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Mon, 9 Sep 2019 12:22:09 -0400 Subject: [PATCH] Add nimbus-specific test --- eth2/utils/ssz_types/src/bitfield.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eth2/utils/ssz_types/src/bitfield.rs b/eth2/utils/ssz_types/src/bitfield.rs index dbe1addbe..cc01d40c7 100644 --- a/eth2/utils/ssz_types/src/bitfield.rs +++ b/eth2/utils/ssz_types/src/bitfield.rs @@ -729,6 +729,13 @@ mod bitvector { assert_eq!(bitfield.ssz_bytes_len(), bytes.len(), "i = {}", i); } } + + #[test] + fn excess_bits_nimbus() { + let bad = vec![0b0001_1111]; + + assert!(BitVector4::from_ssz_bytes(&bad).is_err()); + } } #[cfg(test)]