From 119c7e2b6d9f5a3d900fbd6bd213782098c63edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Laferri=C3=A8re?= Date: Wed, 7 Feb 2024 14:33:51 -0500 Subject: [PATCH] `SmtProof`: add accessors (#276) * add accessors * fmt * comments --- src/merkle/smt/full/proof.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/merkle/smt/full/proof.rs b/src/merkle/smt/full/proof.rs index 4bdbdc8..bd6395c 100644 --- a/src/merkle/smt/full/proof.rs +++ b/src/merkle/smt/full/proof.rs @@ -81,6 +81,16 @@ impl SmtProof { .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)