From 97ca70b8549313d795ef25a40a6b6bf1680236cd Mon Sep 17 00:00:00 2001 From: Sergey Vasilyev Date: Tue, 28 Apr 2020 00:13:10 +0300 Subject: [PATCH] Merkle tree panics when there's a single leaf - test --- crypto-primitives/src/merkle_tree/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crypto-primitives/src/merkle_tree/mod.rs b/crypto-primitives/src/merkle_tree/mod.rs index c621214..366bd1a 100644 --- a/crypto-primitives/src/merkle_tree/mod.rs +++ b/crypto-primitives/src/merkle_tree/mod.rs @@ -418,6 +418,11 @@ mod test { generate_merkle_tree(&leaves); } + #[test] + fn single_leaf_test() { + generate_merkle_tree(&[[1u8; 8]]); + } + fn bad_merkle_tree_verify(leaves: &[L]) -> () { let mut rng = XorShiftRng::seed_from_u64(13423423u64);