From d96dac426187379890fb84315a51d81f37bbd0dc Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Tue, 12 Nov 2024 16:24:19 -0300 Subject: [PATCH] types: Make Utxo::Foreign::sequence not optional It's never kept internally as optional at this point. --- crates/wallet/src/types.rs | 4 ++-- crates/wallet/src/wallet/mod.rs | 2 +- crates/wallet/src/wallet/tx_builder.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/wallet/src/types.rs b/crates/wallet/src/types.rs index c4626fbf..54ddfa26 100644 --- a/crates/wallet/src/types.rs +++ b/crates/wallet/src/types.rs @@ -87,7 +87,7 @@ pub enum Utxo { /// The location of the output. outpoint: OutPoint, /// The nSequence value to set for this input. - sequence: Option, + sequence: Sequence, /// The information about the input we require to add it to a PSBT. // Box it to stop the type being too big. psbt_input: Box, @@ -129,7 +129,7 @@ impl Utxo { pub fn sequence(&self) -> Option { match self { Utxo::Local(_) => None, - Utxo::Foreign { sequence, .. } => *sequence, + Utxo::Foreign { sequence, .. } => Some(*sequence), } } } diff --git a/crates/wallet/src/wallet/mod.rs b/crates/wallet/src/wallet/mod.rs index 68d5e6be..701c3dc2 100644 --- a/crates/wallet/src/wallet/mod.rs +++ b/crates/wallet/src/wallet/mod.rs @@ -1653,7 +1653,7 @@ impl Wallet { WeightedUtxo { utxo: Utxo::Foreign { outpoint: txin.previous_output, - sequence: Some(txin.sequence), + sequence: txin.sequence, psbt_input: Box::new(psbt::Input { witness_utxo: Some(txout.clone()), non_witness_utxo: Some(prev_tx.as_ref().clone()), diff --git a/crates/wallet/src/wallet/tx_builder.rs b/crates/wallet/src/wallet/tx_builder.rs index 343734a8..49f3c19d 100644 --- a/crates/wallet/src/wallet/tx_builder.rs +++ b/crates/wallet/src/wallet/tx_builder.rs @@ -408,7 +408,7 @@ impl<'a, Cs> TxBuilder<'a, Cs> { satisfaction_weight, utxo: Utxo::Foreign { outpoint, - sequence: Some(sequence), + sequence, psbt_input: Box::new(psbt_input), }, }); -- 2.49.0