Browse Source

Merkle tree panics when there's a single leaf - test

master
Sergey Vasilyev 4 years ago
committed by Pratyush Mishra
parent
commit
97ca70b854
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      crypto-primitives/src/merkle_tree/mod.rs

+ 5
- 0
crypto-primitives/src/merkle_tree/mod.rs

@ -418,6 +418,11 @@ mod test {
generate_merkle_tree(&leaves); generate_merkle_tree(&leaves);
} }
#[test]
fn single_leaf_test() {
generate_merkle_tree(&[[1u8; 8]]);
}
fn bad_merkle_tree_verify<L: ToBytes + Clone + Eq>(leaves: &[L]) -> () { fn bad_merkle_tree_verify<L: ToBytes + Clone + Eq>(leaves: &[L]) -> () {
let mut rng = XorShiftRng::seed_from_u64(13423423u64); let mut rng = XorShiftRng::seed_from_u64(13423423u64);

Loading…
Cancel
Save