From 122a42719ae7c5165bb83b047e2387c8f2cb9bcd Mon Sep 17 00:00:00 2001 From: Constance Beguier Date: Thu, 3 Oct 2024 16:19:27 +0200 Subject: [PATCH] Timelimit is u32 and not u64 --- src/builder.rs | 6 +++--- src/bundle.rs | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index cdf81f5f0..a7e661272 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -524,12 +524,12 @@ pub struct Builder { bundle_type: BundleType, anchor: Anchor, // When timelimit is set, the Builder will build an ActionGroup (burn must be empty) - timelimit: Option, + timelimit: Option, } impl Builder { /// Constructs a new empty builder for an Orchard bundle. - pub fn new(bundle_type: BundleType, anchor: Anchor, timelimit: Option) -> Self { + pub fn new(bundle_type: BundleType, anchor: Anchor, timelimit: Option) -> Self { Builder { spends: vec![], outputs: vec![], @@ -768,7 +768,7 @@ fn pad_spend( pub fn bundle, FL: OrchardFlavor>( mut rng: impl RngCore, anchor: Anchor, - timelimit: Option, + timelimit: Option, bundle_type: BundleType, spends: Vec, outputs: Vec, diff --git a/src/bundle.rs b/src/bundle.rs index 7b221a9ca..ce088bc0a 100644 --- a/src/bundle.rs +++ b/src/bundle.rs @@ -210,7 +210,7 @@ pub struct Bundle { /// The timelimit for this Bundle (which is an ActionGroup). /// /// Burn must be empty when timelimit is set. - timelimit: Option, + timelimit: Option, /// The authorization for this bundle. authorization: A, } @@ -243,7 +243,7 @@ impl Bundle { value_balance: V, burn: Vec<(AssetBase, NoteValue)>, anchor: Anchor, - timelimit: Option, + timelimit: Option, authorization: A, ) -> Self { Bundle { @@ -284,6 +284,11 @@ impl Bundle { &self.anchor } + /// Returns the root of the Orchard commitment tree that this bundle commits to. + pub fn timelimit(&self) -> Option { + self.timelimit + } + /// Returns the authorization for this bundle. /// /// In the case of a `Bundle`, this is the proof and binding signature.