diff --git a/zebra-chain/src/block/tests.rs b/zebra-chain/src/block/tests.rs index 1e662bbb9..85fffb626 100644 --- a/zebra-chain/src/block/tests.rs +++ b/zebra-chain/src/block/tests.rs @@ -3,8 +3,6 @@ use std::io::{Cursor, Write}; use chrono::NaiveDateTime; use proptest::{ arbitrary::{any, Arbitrary}, - collection::vec, - option, prelude::*, }; diff --git a/zebra-chain/src/equihash_solution.rs b/zebra-chain/src/equihash_solution.rs index af1ef59c1..44cc37236 100644 --- a/zebra-chain/src/equihash_solution.rs +++ b/zebra-chain/src/equihash_solution.rs @@ -20,12 +20,6 @@ const EQUIHASH_SOLUTION_SIZE: usize = 1344; /// length of this type is fixed. pub struct EquihashSolution(pub [u8; EQUIHASH_SOLUTION_SIZE]); -impl Default for EquihashSolution { - fn default() -> Self { - EquihashSolution([0; EQUIHASH_SOLUTION_SIZE]) - } -} - impl PartialEq for EquihashSolution { fn eq(&self, other: &EquihashSolution) -> bool { self.0.as_ref() == other.0.as_ref() @@ -87,18 +81,24 @@ impl Arbitrary for EquihashSolution { } #[cfg(test)] -proptest! { +mod tests { - #[test] - fn encrypted_ciphertext_roundtrip(solution in any::()) { + use super::*; - let mut data = Vec::new(); + proptest! { - solution.zcash_serialize(&mut data).expect("EquihashSolution should serialize"); + #[test] + fn equihash_solution_roundtrip(solution in any::()) { - let solution2 = EquihashSolution::zcash_deserialize(&data[..]).expect("randomized EquihashSolution should deserialize"); + let mut data = Vec::new(); + + solution.zcash_serialize(&mut data).expect("EquihashSolution should serialize"); + + let solution2 = EquihashSolution::zcash_deserialize(&data[..]) + .expect("randomized EquihashSolution should deserialize"); + + prop_assert_eq![solution, solution2]; + } - prop_assert_eq![solution, solution2]; } - }