Skip to content

Commit

Permalink
feat: add leaf count to SimpleSmt (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
polydez authored Apr 2, 2024
1 parent 4885f88 commit b4dc373
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/merkle/smt/simple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ impl<const DEPTH: u8> SimpleSmt<DEPTH> {
<Self as SparseMerkleTree<DEPTH>>::open(self, key)
}

/// Returns a count of non-empty leaves.
pub fn leaf_count(&self) -> usize {
self.leaves.len()
}

// ITERATORS
// --------------------------------------------------------------------------------------------

Expand Down

0 comments on commit b4dc373

Please sign in to comment.