diff --git a/zebra-chain/src/transaction/joinsplit.rs b/zebra-chain/src/transaction/joinsplit.rs index a2b38995..008fd799 100644 --- a/zebra-chain/src/transaction/joinsplit.rs +++ b/zebra-chain/src/transaction/joinsplit.rs @@ -64,7 +64,6 @@ pub struct JoinSplit { /// A bundle of JoinSplit descriptions and signature data. #[derive(Clone, Debug, PartialEq, Eq)] -#[cfg_attr(test, derive(Arbitrary))] pub struct JoinSplitData { /// The first JoinSplit description, using proofs of type `P`. /// @@ -93,6 +92,31 @@ impl JoinSplitData

{ } } +#[cfg(test)] +impl Arbitrary for JoinSplitData

{ + type Parameters = (); + + fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy { + ( + any::>(), + vec(any::>()), + vec(any::(), 32), + vec(any::(), 64), + ) + .prop_map(|first, rest, pub_key_bytes, sig_bytes| { + return Self { + first: first, + rest: rest, + pub_key: ed25519_zebra::PublicKeyBytes::from(pub_key_bytes), + sig: ed25519_zebra::Signature::from(sig_bytes), + }; + }) + .boxed() + } + + type Strategy = BoxedStrategy; +} + /// A ciphertext component for encrypted output notes. pub struct EncryptedCiphertext(pub [u8; 601]);