feat: add leaf count to SimpleSmt (#302)

This commit is contained in:
polydez 2024-04-03 00:07:00 +05:00 committed by GitHub
parent 4885f885a4
commit b4dc373925
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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