From: Steven Roose Date: Tue, 12 Nov 2024 19:24:19 +0000 (-0300) Subject: types: Make Utxo::Foreign::sequence not optional X-Git-Tag: v1.0.0-beta.6~15^2 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/static/struct.CommandStringError.html?a=commitdiff_plain;h=d96dac426187379890fb84315a51d81f37bbd0dc;p=bdk types: Make Utxo::Foreign::sequence not optional It's never kept internally as optional at this point. --- 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), }, });