feat: add Smt::is_empty (#337)

This commit is contained in:
Andrey Khmuro
2024-10-18 00:27:50 +03:00
committed by GitHub
parent e82baa35bb
commit 940cc04670
6 changed files with 45 additions and 0 deletions

View File

@@ -516,6 +516,16 @@ fn test_smt_entries() {
assert!(entries.next().is_none());
}
/// Tests that `EMPTY_ROOT` constant generated in the `Smt` equals to the root of the empty tree of
/// depth 64
#[test]
fn test_smt_check_empty_root_constant() {
// get the root of the empty tree of depth 64
let empty_root_64_depth = EmptySubtreeRoots::empty_hashes(64)[0];
assert_eq!(empty_root_64_depth, Smt::EMPTY_ROOT);
}
// SMT LEAF
// --------------------------------------------------------------------------------------------