arnaucube
arnaucube/miden-cryptoPublic Self-hosted repository
Merge pull request #146 from 0xPolygonMiden/frisitano-merkle-store-inner-nodes

feat: add .inner_nodes() to [MerkleStore]
Bobbin Threadbare 43513081+bobbinth@users.noreply.github.com
Thu, 04 May 2023 13:49:36 -0700
commit

52409ac0391826988ea457c157c61ba800d98ef7

parent

52db23cd423e01a92eaf92abfd25aeef5b882c92

1 files changed, 9 insertions(+), 0 deletions(-)

jump to
M src/merkle/store/mod.rs → src/merkle/store/mod.rs

@@ -257,6 +257,15 @@ // depleted bits; return max depth

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