Browse Source

Merge pull request #146 from 0xPolygonMiden/frisitano-merkle-store-inner-nodes

feat: add .inner_nodes() to [MerkleStore]
al-gkr-basic-workflow
Bobbin Threadbare 1 year ago
committed by GitHub
parent
commit
52409ac039
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      src/merkle/store/mod.rs

+ 9
- 0
src/merkle/store/mod.rs

@ -257,6 +257,15 @@ impl MerkleStore {
Ok(tree_depth)
}
/// Iterator over the inner nodes of the [MerkleStore].
pub fn inner_nodes(&self) -> impl Iterator<Item = InnerNodeInfo> + '_ {
self.nodes.iter().map(|(r, n)| InnerNodeInfo {
value: r.into(),
left: n.left.into(),
right: n.right.into(),
})
}
// STATE MUTATORS
// --------------------------------------------------------------------------------------------

Loading…
Cancel
Save