From 90086d4d2d306e3e152ed157774666e55fa9d86a Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Mon, 27 Jan 2020 17:49:25 -0500 Subject: [PATCH] derive(Arbitrary) on Sapling*Note*Tree types --- zebra-chain/src/note_commitment_tree.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zebra-chain/src/note_commitment_tree.rs b/zebra-chain/src/note_commitment_tree.rs index 8f1c2892..4eba6a24 100644 --- a/zebra-chain/src/note_commitment_tree.rs +++ b/zebra-chain/src/note_commitment_tree.rs @@ -12,6 +12,9 @@ use std::io; +#[cfg(test)] +use proptest_derive::Arbitrary; + use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize}; // XXX: Depending on if we implement SproutNoteCommitmentTree or @@ -19,6 +22,7 @@ use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize} /// Sapling Note Commitment Tree #[derive(Clone, Debug, Default, Eq, PartialEq)] +#[cfg_attr(test, derive(Arbitrary))] pub struct SaplingNoteCommitmentTree; /// Sapling note commitment tree root node hash. @@ -28,6 +32,7 @@ pub struct SaplingNoteCommitmentTree; /// this block. A root of a note commitment tree is associated with /// each treestate. #[derive(Clone, Debug, Default, Eq, PartialEq)] +#[cfg_attr(test, derive(Arbitrary))] pub struct SaplingNoteTreeRootHash(pub [u8; 32]); impl From for SaplingNoteTreeRootHash {