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

feat: add .inner_nodes() to [MerkleStore]
This commit is contained in:
Bobbin Threadbare
2023-05-04 13:49:36 -07:00
committed by GitHub

View File

@@ -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
// --------------------------------------------------------------------------------------------