feat: add leaf count to SimpleSmt
(#302)
This commit is contained in:
parent
4885f885a4
commit
b4dc373925
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
// --------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue