diff --git a/zebra-chain/src/proofs/bctv14.rs b/zebra-chain/src/proofs/bctv14.rs index 5a52f9b6..dd5c99a7 100644 --- a/zebra-chain/src/proofs/bctv14.rs +++ b/zebra-chain/src/proofs/bctv14.rs @@ -1,8 +1,5 @@ use std::{fmt, io}; -#[cfg(test)] -use proptest::{arbitrary::Arbitrary, collection::vec, prelude::*}; - use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize}; /// An encoding of a BCTV14 proof, as used in Zcash. @@ -51,6 +48,9 @@ impl ZcashDeserialize for Bctv14Proof { } } +#[cfg(test)] +use proptest::{arbitrary::Arbitrary, collection::vec, prelude::*}; + #[cfg(test)] impl Arbitrary for Bctv14Proof { type Parameters = (); diff --git a/zebra-chain/src/proofs/groth16.rs b/zebra-chain/src/proofs/groth16.rs index 724fea56..6fd9a4b9 100644 --- a/zebra-chain/src/proofs/groth16.rs +++ b/zebra-chain/src/proofs/groth16.rs @@ -1,8 +1,5 @@ use std::{fmt, io}; -#[cfg(test)] -use proptest::{arbitrary::Arbitrary, collection::vec, prelude::*}; - use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize}; /// An encoding of a Groth16 proof, as used in Zcash. @@ -51,6 +48,9 @@ impl ZcashDeserialize for Groth16Proof { } } +#[cfg(test)] +use proptest::{arbitrary::Arbitrary, collection::vec, prelude::*}; + #[cfg(test)] impl Arbitrary for Groth16Proof { type Parameters = (); diff --git a/zebra-chain/src/transaction/shielded_data.rs b/zebra-chain/src/transaction/shielded_data.rs index a80c1494..0d1cfa33 100644 --- a/zebra-chain/src/transaction/shielded_data.rs +++ b/zebra-chain/src/transaction/shielded_data.rs @@ -1,8 +1,10 @@ use std::{fmt, io}; use futures::future::Either; + #[cfg(test)] use proptest::{arbitrary::Arbitrary, array, collection::vec, prelude::*}; + #[cfg(test)] use proptest_derive::Arbitrary; diff --git a/zebra-chain/src/types.rs b/zebra-chain/src/types.rs index f2430a9b..60ae4f28 100644 --- a/zebra-chain/src/types.rs +++ b/zebra-chain/src/types.rs @@ -8,8 +8,7 @@ use std::{ use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use chrono::{DateTime, TimeZone, Utc}; use hex; -#[cfg(test)] -use proptest::prelude::*; + #[cfg(test)] use proptest_derive::Arbitrary; @@ -126,6 +125,9 @@ impl ZcashDeserialize for Script { } } +#[cfg(test)] +use proptest::prelude::*; + #[cfg(test)] mod tests { use super::*;