Skip to content

Commit

Permalink
Timelimit is u32 and not u64
Browse files Browse the repository at this point in the history
  • Loading branch information
ConstanceBeguier committed Oct 10, 2024
1 parent daccf7c commit 122a427
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u64>,
timelimit: Option<u32>,
}

impl Builder {
/// Constructs a new empty builder for an Orchard bundle.
pub fn new(bundle_type: BundleType, anchor: Anchor, timelimit: Option<u64>) -> Self {
pub fn new(bundle_type: BundleType, anchor: Anchor, timelimit: Option<u32>) -> Self {
Builder {
spends: vec![],
outputs: vec![],
Expand Down Expand Up @@ -768,7 +768,7 @@ fn pad_spend(
pub fn bundle<V: TryFrom<i64>, FL: OrchardFlavor>(
mut rng: impl RngCore,
anchor: Anchor,
timelimit: Option<u64>,
timelimit: Option<u32>,
bundle_type: BundleType,
spends: Vec<SpendInfo>,
outputs: Vec<OutputInfo>,
Expand Down
9 changes: 7 additions & 2 deletions src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ pub struct Bundle<A: Authorization, V, D: OrchardDomainCommon> {
/// The timelimit for this Bundle (which is an ActionGroup).
///
/// Burn must be empty when timelimit is set.
timelimit: Option<u64>,
timelimit: Option<u32>,
/// The authorization for this bundle.
authorization: A,
}
Expand Down Expand Up @@ -243,7 +243,7 @@ impl<A: Authorization, V, D: OrchardDomainCommon> Bundle<A, V, D> {
value_balance: V,
burn: Vec<(AssetBase, NoteValue)>,
anchor: Anchor,
timelimit: Option<u64>,
timelimit: Option<u32>,
authorization: A,
) -> Self {
Bundle {
Expand Down Expand Up @@ -284,6 +284,11 @@ impl<A: Authorization, V, D: OrchardDomainCommon> Bundle<A, V, D> {
&self.anchor
}

/// Returns the root of the Orchard commitment tree that this bundle commits to.
pub fn timelimit(&self) -> Option<u32> {
self.timelimit
}

/// Returns the authorization for this bundle.
///
/// In the case of a `Bundle<Authorized>`, this is the proof and binding signature.
Expand Down

0 comments on commit 122a427

Please sign in to comment.