Skip to content

Commit

Permalink
add empty leaf hash test
Browse files Browse the repository at this point in the history
  • Loading branch information
plafer committed Jan 19, 2024
1 parent a880c88 commit 21214ca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/merkle/smt/full/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,15 @@ fn test_smt_path_to_keys_in_same_leaf_are_equal() {
assert_eq!(smt.open(&key_1), smt.open(&key_2));
}

/// Tests that an empty leaf hashes to the empty word
#[test]
fn test_empty_leaf_hash() {
let smt = Smt::default();

let leaf = smt.get_leaf(&RpoDigest::default());
assert_eq!(leaf.hash(), EMPTY_WORD.into());
}

// HELPERS
// --------------------------------------------------------------------------------------------

Expand Down

0 comments on commit 21214ca

Please sign in to comment.