Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.16.1 (TBD)

- Added `{Smt,PartialSmt}::inner_node_indices` to make inner nodes accessible ([#494](https://github.com/0xMiden/crypto/pull/494)).

## 0.16.0 (2025-08-15)

- [BREAKING] Incremented MSRV to 1.88.
Expand Down
5 changes: 5 additions & 0 deletions miden-crypto/src/merkle/smt/full/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ impl Smt {
})
}

/// Returns an iterator over the [`InnerNode`] and the respective [`NodeIndex`] of the [`Smt`].
pub fn inner_node_indices(&self) -> impl Iterator<Item = (NodeIndex, InnerNode)> + '_ {
self.inner_nodes.iter().map(|(idx, inner)| (*idx, inner.clone()))
}

// STATE MUTATORS
// --------------------------------------------------------------------------------------------

Expand Down
6 changes: 6 additions & 0 deletions miden-crypto/src/merkle/smt/partial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ impl PartialSmt {
self.0.inner_nodes()
}

/// Returns an iterator over the [`InnerNode`] and the respective [`NodeIndex`] of the
/// [`PartialSmt`].
pub fn inner_node_indicies(&self) -> impl Iterator<Item = (NodeIndex, InnerNode)> + '_ {
self.0.inner_node_indices()
}

/// Returns an iterator over the tracked, non-empty leaves of the [`PartialSmt`] in arbitrary
/// order.
pub fn leaves(&self) -> impl Iterator<Item = (LeafIndex<SMT_DEPTH>, &SmtLeaf)> {
Expand Down