Browse Source

feat: add leaf count to `SimpleSmt` (#302)

al-falcon-test-vectors
polydez 1 year ago
committed by GitHub
parent
commit
b4dc373925
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/merkle/smt/simple/mod.rs

+ 5
- 0
src/merkle/smt/simple/mod.rs

@ -152,6 +152,11 @@ impl SimpleSmt {
<Self as SparseMerkleTree<DEPTH>>::open(self, key)
}
/// Returns a count of non-empty leaves.
pub fn leaf_count(&self) -> usize {
self.leaves.len()
}
// ITERATORS
// --------------------------------------------------------------------------------------------

Loading…
Cancel
Save