use epee_encoding::{from_bytes, EpeeObject}; #[derive(EpeeObject)] struct T { a: u8, } #[derive(EpeeObject)] struct TT { #[epee_default(0)] a: u8, } #[test] fn duplicate_key() { let data = [ 0x01, 0x11, 0x01, 0x1, 0x01, 0x01, 0x02, 0x1, 0x1, 0x08, 0x01, b'a', 0x0B, 0x00, 0x01, b'a', 0x0B, 0x00, ]; assert!(from_bytes::(&data).is_err()); } #[test] fn duplicate_key_with_default() { let data = [ 0x01, 0x11, 0x01, 0x1, 0x01, 0x01, 0x02, 0x1, 0x1, 0x08, 0x01, b'a', 0x0B, 0x00, 0x01, b'a', 0x0B, 0x00, ]; assert!(from_bytes::(&data).is_err()); }