arnaucube
arnaucube/miden-cryptoPublic Self-hosted repository
`SmtProof`: add accessors (#276)

* add accessors

* fmt

* comments
Philippe Laferrière plafer@protonmail.com
Wed, 07 Feb 2024 14:33:51 -0500
commit

119c7e2b6d9f5a3d900fbd6bd213782098c63edc

parent

45e7e78118418d897f34c045d052613daaa150c3

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

jump to
M src/merkle/smt/full/proof.rs → src/merkle/smt/full/proof.rs

@@ -81,6 +81,16 @@ .compute_root(self.leaf.index().value(), self.leaf.hash())

.expect("failed to compute Merkle path root") } + /// Returns the proof's Merkle path. + pub fn path(&self) -> &MerklePath { + &self.path + } + + /// Returns the leaf associated with the proof. + pub fn leaf(&self) -> &SmtLeaf { + &self.leaf + } + /// Consume the proof and returns its parts. pub fn into_parts(self) -> (MerklePath, SmtLeaf) { (self.path, self.leaf)