diff --git a/crypto-primitives/src/merkle_tree/mod.rs b/crypto-primitives/src/merkle_tree/mod.rs index 2861def..c621214 100644 --- a/crypto-primitives/src/merkle_tree/mod.rs +++ b/crypto-primitives/src/merkle_tree/mod.rs @@ -378,7 +378,7 @@ mod test { struct JubJubMerkleTreeParams; impl MerkleTreeConfig for JubJubMerkleTreeParams { - const HEIGHT: usize = 32; + const HEIGHT: usize = 8; type H = H; } type JubJubMerkleTree = MerkleHashTree; @@ -409,6 +409,15 @@ mod test { generate_merkle_tree(&leaves); } + #[test] + fn no_dummy_nodes_test() { + let mut leaves = Vec::new(); + for i in 0..(1u8 << JubJubMerkleTree::HEIGHT - 1) { + leaves.push([i, i, i, i, i, i, i, i]); + } + generate_merkle_tree(&leaves); + } + fn bad_merkle_tree_verify(leaves: &[L]) -> () { let mut rng = XorShiftRng::seed_from_u64(13423423u64);