diff --git a/coins/monero/wallet/src/tests/extra.rs b/coins/monero/wallet/src/tests/extra.rs index 8dcd51f6..2f331e61 100644 --- a/coins/monero/wallet/src/tests/extra.rs +++ b/coins/monero/wallet/src/tests/extra.rs @@ -105,15 +105,13 @@ fn padding_only_max_size() { #[test] fn padding_only_exceed_max_size() { let buf: Vec = vec![0; MAX_TX_EXTRA_PADDING_COUNT + 1]; - let extra = Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap(); - assert!(extra.0.is_empty()); + Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap_err(); } #[test] fn invalid_padding_only() { let buf: Vec = vec![0, 42]; - let extra = Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap(); - assert!(extra.0.is_empty()); + Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap_err(); } #[test] @@ -137,8 +135,7 @@ fn extra_nonce_only_wrong_size() { let mut buf: Vec = vec![0; 20]; buf[0] = 2; buf[1] = 255; - let extra = Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap(); - assert!(extra.0.is_empty()); + Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap_err(); } #[test] @@ -158,8 +155,7 @@ fn pub_key_and_padding() { fn pub_key_and_invalid_padding() { let mut buf: Vec = PUB_KEY_BYTES.to_vec(); buf.extend([0, 1]); - let extra = Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap(); - assert_eq!(extra.0, vec![ExtraField::PublicKey(pub_key())]); + Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap_err(); } #[test] @@ -185,8 +181,7 @@ fn extra_mysterious_minergate_only_wrong_size() { let mut buf: Vec = vec![0; 20]; buf[0] = 222; buf[1] = 255; - let extra = Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap(); - assert!(extra.0.is_empty()); + Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap_err(); } #[test]