From 380128ed496417ca4a280f0842e4543959350867 Mon Sep 17 00:00:00 2001 From: therealyingtong Date: Thu, 10 Jun 2021 16:55:49 +0800 Subject: [PATCH] tree::MerklePath: Add postion() and auth_path() getters. --- src/tree.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tree.rs b/src/tree.rs index c59f2e7f..9777c18a 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -59,6 +59,16 @@ impl MerklePath { }); Anchor(node.to_bytes()) } + + /// Returns the position of the leaf using this Merkle path. + pub fn position(&self) -> u32 { + self.position + } + + /// Returns the authentication path. + pub fn auth_path(&self) -> [pallas::Base; MERKLE_DEPTH_ORCHARD] { + self.auth_path + } } struct Pair {