Skip to content

Commit 345e69e

Browse files
committed
Update bitcoin crate to 0.29.0
1 parent d024251 commit 345e69e

36 files changed

+208
-182
lines changed

fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ stdin_fuzz = []
2020
afl = { version = "0.4", optional = true }
2121
lightning = { path = "../lightning", features = ["regex"] }
2222
lightning-rapid-gossip-sync = { path = "../lightning-rapid-gossip-sync" }
23-
bitcoin = { version = "0.28.1", features = ["secp-lowmemory"] }
23+
bitcoin = { version = "0.29.0", features = ["secp-lowmemory"] }
2424
hex = "0.3"
2525
honggfuzz = { version = "0.5", optional = true }
2626
libfuzzer-sys = { version = "0.4", optional = true }

fuzz/src/chanmon_consistency.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl KeysInterface for KeyProvider {
169169
fn ecdh(&self, recipient: Recipient, other_key: &PublicKey, tweak: Option<&[u8; 32]>) -> Result<SharedSecret, ()> {
170170
let mut node_secret = self.get_node_secret(recipient)?;
171171
if let Some(tweak) = tweak {
172-
node_secret.mul_assign(tweak).map_err(|_| ())?;
172+
node_secret = node_secret.mul_tweak(tweak).map_err(|_| ())?;
173173
}
174174
Ok(SharedSecret::new(other_key, &node_secret))
175175
}
@@ -447,7 +447,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
447447
let events = $source.get_and_clear_pending_events();
448448
assert_eq!(events.len(), 1);
449449
if let events::Event::FundingGenerationReady { ref temporary_channel_id, ref channel_value_satoshis, ref output_script, .. } = events[0] {
450-
let tx = Transaction { version: $chan_id, lock_time: 0, input: Vec::new(), output: vec![TxOut {
450+
let tx = Transaction { version: $chan_id, lock_time: PackedLockTime::ZERO, input: Vec::new(), output: vec![TxOut {
451451
value: *channel_value_satoshis, script_pubkey: output_script.clone(),
452452
}]};
453453
funding_output = OutPoint { txid: tx.txid(), index: 0 };
@@ -481,11 +481,11 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
481481
macro_rules! confirm_txn {
482482
($node: expr) => { {
483483
let chain_hash = genesis_block(Network::Bitcoin).block_hash();
484-
let mut header = BlockHeader { version: 0x20000000, prev_blockhash: chain_hash, merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
484+
let mut header = BlockHeader { version: 0x20000000, prev_blockhash: chain_hash, merkle_root: TxMerkleNode::all_zeros(), time: 42, bits: 42, nonce: 42 };
485485
let txdata: Vec<_> = channel_txn.iter().enumerate().map(|(i, tx)| (i + 1, tx)).collect();
486486
$node.transactions_confirmed(&header, &txdata, 1);
487487
for _ in 2..100 {
488-
header = BlockHeader { version: 0x20000000, prev_blockhash: header.block_hash(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
488+
header = BlockHeader { version: 0x20000000, prev_blockhash: header.block_hash(), merkle_root: TxMerkleNode::all_zeros(), time: 42, bits: 42, nonce: 42 };
489489
}
490490
$node.best_block_updated(&header, 99);
491491
} }

fuzz/src/full_stack.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl<'a> MoneyLossDetector<'a> {
213213
}
214214

215215
self.blocks_connected += 1;
216-
let header = BlockHeader { version: 0x20000000, prev_blockhash: self.header_hashes[self.height].0, merkle_root: Default::default(), time: self.blocks_connected, bits: 42, nonce: 42 };
216+
let header = BlockHeader { version: 0x20000000, prev_blockhash: self.header_hashes[self.height].0, merkle_root: TxMerkleNode::all_zeros(), time: self.blocks_connected, bits: 42, nonce: 42 };
217217
self.height += 1;
218218
self.manager.transactions_confirmed(&header, &txdata, self.height as u32);
219219
self.manager.best_block_updated(&header, self.height as u32);
@@ -230,7 +230,7 @@ impl<'a> MoneyLossDetector<'a> {
230230

231231
fn disconnect_block(&mut self) {
232232
if self.height > 0 && (self.max_height < 6 || self.height >= self.max_height - 6) {
233-
let header = BlockHeader { version: 0x20000000, prev_blockhash: self.header_hashes[self.height - 1].0, merkle_root: Default::default(), time: self.header_hashes[self.height].1, bits: 42, nonce: 42 };
233+
let header = BlockHeader { version: 0x20000000, prev_blockhash: self.header_hashes[self.height - 1].0, merkle_root: TxMerkleNode::all_zeros(), time: self.header_hashes[self.height].1, bits: 42, nonce: 42 };
234234
self.manager.block_disconnected(&header, self.height as u32);
235235
self.monitor.block_disconnected(&header, self.height as u32);
236236
self.height -= 1;
@@ -273,7 +273,7 @@ impl KeysInterface for KeyProvider {
273273
fn ecdh(&self, recipient: Recipient, other_key: &PublicKey, tweak: Option<&[u8; 32]>) -> Result<SharedSecret, ()> {
274274
let mut node_secret = self.get_node_secret(recipient)?;
275275
if let Some(tweak) = tweak {
276-
node_secret.mul_assign(tweak).map_err(|_| ())?;
276+
node_secret = node_secret.mul_tweak(tweak).map_err(|_| ())?;
277277
}
278278
Ok(SharedSecret::new(other_key, &node_secret))
279279
}
@@ -564,7 +564,7 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
564564
},
565565
10 => {
566566
'outer_loop: for funding_generation in pending_funding_generation.drain(..) {
567-
let mut tx = Transaction { version: 0, lock_time: 0, input: Vec::new(), output: vec![TxOut {
567+
let mut tx = Transaction { version: 0, lock_time: PackedLockTime::ZERO, input: Vec::new(), output: vec![TxOut {
568568
value: funding_generation.2, script_pubkey: funding_generation.3,
569569
}] };
570570
let funding_output = 'search_loop: loop {

lightning-background-processor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ all-features = true
1414
rustdoc-args = ["--cfg", "docsrs"]
1515

1616
[dependencies]
17-
bitcoin = "0.28.1"
17+
bitcoin = "0.29.0"
1818
lightning = { version = "0.0.110", path = "../lightning", features = ["std"] }
1919
lightning-rapid-gossip-sync = { version = "0.0.110", path = "../lightning-rapid-gossip-sync" }
2020

lightning-background-processor/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ impl Drop for BackgroundProcessor {
488488
mod tests {
489489
use bitcoin::blockdata::block::BlockHeader;
490490
use bitcoin::blockdata::constants::genesis_block;
491+
use bitcoin::blockdata::locktime::PackedLockTime;
491492
use bitcoin::blockdata::transaction::{Transaction, TxOut};
492493
use bitcoin::network::constants::Network;
493494
use lightning::chain::{BestBlock, Confirm, chainmonitor};
@@ -513,6 +514,8 @@ mod tests {
513514
use std::sync::{Arc, Mutex};
514515
use std::sync::mpsc::SyncSender;
515516
use std::time::Duration;
517+
use bitcoin::hashes::Hash;
518+
use bitcoin::TxMerkleNode;
516519
use lightning::routing::scoring::{FixedPenaltyScorer};
517520
use lightning_rapid_gossip_sync::RapidGossipSync;
518521
use super::{BackgroundProcessor, GossipSync, FRESHNESS_TIMER};
@@ -700,7 +703,7 @@ mod tests {
700703
assert_eq!(channel_value_satoshis, $channel_value);
701704
assert_eq!(user_channel_id, 42);
702705

703-
let tx = Transaction { version: 1 as i32, lock_time: 0, input: Vec::new(), output: vec![TxOut {
706+
let tx = Transaction { version: 1 as i32, lock_time: PackedLockTime(0), input: Vec::new(), output: vec![TxOut {
704707
value: channel_value_satoshis, script_pubkey: output_script.clone(),
705708
}]};
706709
(temporary_channel_id, tx)
@@ -722,7 +725,7 @@ mod tests {
722725
for i in 1..=depth {
723726
let prev_blockhash = node.best_block.block_hash();
724727
let height = node.best_block.height() + 1;
725-
let header = BlockHeader { version: 0x20000000, prev_blockhash, merkle_root: Default::default(), time: height, bits: 42, nonce: 42 };
728+
let header = BlockHeader { version: 0x20000000, prev_blockhash, merkle_root: TxMerkleNode::all_zeros(), time: height, bits: 42, nonce: 42 };
726729
let txdata = vec![(0, tx)];
727730
node.best_block = BestBlock::new(header.block_hash(), height);
728731
match i {

lightning-block-sync/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rest-client = [ "serde", "serde_json", "chunked_transfer" ]
1818
rpc-client = [ "serde", "serde_json", "chunked_transfer" ]
1919

2020
[dependencies]
21-
bitcoin = "0.28.1"
21+
bitcoin = "0.29.0"
2222
lightning = { version = "0.0.110", path = "../lightning" }
2323
futures = { version = "0.3" }
2424
tokio = { version = "1.0", features = [ "io-util", "net", "time" ], optional = true }

lightning-block-sync/src/test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use bitcoin::hash_types::BlockHash;
77
use bitcoin::network::constants::Network;
88
use bitcoin::util::uint::Uint256;
99
use bitcoin::util::hash::bitcoin_merkle_root;
10-
use bitcoin::Transaction;
10+
use bitcoin::{PackedLockTime, Transaction};
1111

1212
use lightning::chain;
1313

@@ -45,7 +45,7 @@ impl Blockchain {
4545
// but that's OK because those tests don't trigger the check.
4646
let coinbase = Transaction {
4747
version: 0,
48-
lock_time: 0,
48+
lock_time: PackedLockTime::ZERO,
4949
input: vec![],
5050
output: vec![]
5151
};

lightning-invoice/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ no-std = ["hashbrown", "lightning/no-std", "core2/alloc"]
1919
std = ["bitcoin_hashes/std", "num-traits/std", "lightning/std", "bech32/std"]
2020

2121
[dependencies]
22-
bech32 = { version = "0.8", default-features = false }
22+
bech32 = { version = "0.9.0", default-features = false }
2323
lightning = { version = "0.0.110", path = "../lightning", default-features = false }
24-
secp256k1 = { version = "0.22", default-features = false, features = ["recovery", "alloc"] }
24+
secp256k1 = { version = "0.24.0", default-features = false, features = ["recovery", "alloc"] }
2525
num-traits = { version = "0.2.8", default-features = false }
2626
bitcoin_hashes = { version = "0.10", default-features = false }
2727
hashbrown = { version = "0.11", optional = true }

lightning-net-tokio/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ all-features = true
1515
rustdoc-args = ["--cfg", "docsrs"]
1616

1717
[dependencies]
18-
bitcoin = "0.28.1"
18+
bitcoin = "0.29.0"
1919
lightning = { version = "0.0.110", path = "../lightning" }
2020
tokio = { version = "1.0", features = [ "io-util", "macros", "rt", "sync", "net", "time" ] }
2121

lightning-persister/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ rustdoc-args = ["--cfg", "docsrs"]
1616
_bench_unstable = ["lightning/_bench_unstable"]
1717

1818
[dependencies]
19-
bitcoin = "0.28.1"
19+
bitcoin = "0.29.0"
2020
lightning = { version = "0.0.110", path = "../lightning" }
2121
libc = "0.2"
2222

lightning-persister/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ mod tests {
134134
use crate::FilesystemPersister;
135135
use bitcoin::blockdata::block::{Block, BlockHeader};
136136
use bitcoin::hashes::hex::FromHex;
137-
use bitcoin::Txid;
137+
use bitcoin::{Txid, TxMerkleNode};
138138
use lightning::chain::ChannelMonitorUpdateErr;
139139
use lightning::chain::chainmonitor::Persist;
140140
use lightning::chain::transaction::OutPoint;
@@ -144,6 +144,7 @@ mod tests {
144144
use lightning::util::events::{ClosureReason, MessageSendEventsProvider};
145145
use lightning::util::test_utils;
146146
use std::fs;
147+
use bitcoin::hashes::Hash;
147148
#[cfg(target_os = "windows")]
148149
use {
149150
lightning::get_event_msg,
@@ -221,7 +222,7 @@ mod tests {
221222
let node_txn = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap();
222223
assert_eq!(node_txn.len(), 1);
223224

224-
let header = BlockHeader { version: 0x20000000, prev_blockhash: nodes[0].best_block_hash(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
225+
let header = BlockHeader { version: 0x20000000, prev_blockhash: nodes[0].best_block_hash(), merkle_root: TxMerkleNode::all_zeros(), time: 42, bits: 42, nonce: 42 };
225226
connect_block(&nodes[1], &Block { header, txdata: vec![node_txn[0].clone(), node_txn[0].clone()]});
226227
check_closed_broadcast!(nodes[1], true);
227228
check_closed_event!(nodes[1], 1, ClosureReason::CommitmentTxConfirmed);

lightning-rapid-gossip-sync/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _bench_unstable = []
1414

1515
[dependencies]
1616
lightning = { version = "0.0.110", path = "../lightning" }
17-
bitcoin = { version = "0.28.1", default-features = false }
17+
bitcoin = { version = "0.29.0", default-features = false }
1818

1919
[dev-dependencies]
2020
lightning = { version = "0.0.110", path = "../lightning", features = ["_test_utils"] }

lightning/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ grind_signatures = []
3838
default = ["std", "grind_signatures"]
3939

4040
[dependencies]
41-
bitcoin = { version = "0.28.1", default-features = false, features = ["secp-recovery"] }
41+
bitcoin = { version = "0.29.0", default-features = false, features = ["secp-recovery"] }
4242

4343
hashbrown = { version = "0.11", optional = true }
4444
hex = { version = "0.4", optional = true }
@@ -52,6 +52,6 @@ hex = "0.4"
5252
regex = "1.5.6"
5353

5454
[dev-dependencies.bitcoin]
55-
version = "0.28.1"
55+
version = "0.29.0"
5656
default-features = false
5757
features = ["bitcoinconsensus", "secp-recovery"]

lightning/src/chain/chainmonitor.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,8 @@ impl<ChannelSigner: Sign, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref> even
733733

734734
#[cfg(test)]
735735
mod tests {
736-
use bitcoin::BlockHeader;
736+
use bitcoin::{BlockHeader, TxMerkleNode};
737+
use bitcoin::hashes::Hash;
737738
use ::{check_added_monitors, check_closed_broadcast, check_closed_event};
738739
use ::{expect_payment_sent, expect_payment_claimed, expect_payment_sent_without_paths, expect_payment_path_successful, get_event_msg};
739740
use ::{get_htlc_update_msgs, get_local_commitment_txn, get_revoke_commit_msgs, get_route_and_payment_hash, unwrap_send_err};
@@ -900,7 +901,7 @@ mod tests {
900901
let new_header = BlockHeader {
901902
version: 2, time: 0, bits: 0, nonce: 0,
902903
prev_blockhash: nodes[0].best_block_info().0,
903-
merkle_root: Default::default() };
904+
merkle_root: TxMerkleNode::all_zeros() };
904905
nodes[0].chain_monitor.chain_monitor.transactions_confirmed(&new_header,
905906
&[(0, &remote_txn[0]), (1, &remote_txn[1])], nodes[0].best_block_info().1 + 1);
906907
assert!(nodes[0].chain_monitor.release_pending_monitor_events().is_empty());
@@ -926,7 +927,7 @@ mod tests {
926927
let latest_header = BlockHeader {
927928
version: 2, time: 0, bits: 0, nonce: 0,
928929
prev_blockhash: nodes[0].best_block_info().0,
929-
merkle_root: Default::default() };
930+
merkle_root: TxMerkleNode::all_zeros() };
930931
nodes[0].chain_monitor.chain_monitor.best_block_updated(&latest_header, nodes[0].best_block_info().1 + LATENCY_GRACE_PERIOD_BLOCKS);
931932
} else {
932933
let persistences = chanmon_cfgs[0].persister.chain_sync_monitor_persistences.lock().unwrap().clone();

lightning/src/chain/channelmonitor.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ impl Writeable for OnchainEventEntry {
404404

405405
impl MaybeReadable for OnchainEventEntry {
406406
fn read<R: io::Read>(reader: &mut R) -> Result<Option<Self>, DecodeError> {
407-
let mut txid = Default::default();
407+
let mut txid = Txid::all_zeros();
408408
let mut height = 0;
409409
let mut event = None;
410410
read_tlv_fields!(reader, {
@@ -1756,12 +1756,12 @@ macro_rules! fail_unbroadcast_htlcs {
17561756

17571757
#[cfg(test)]
17581758
pub fn deliberately_bogus_accepted_htlc_witness_program() -> Vec<u8> {
1759-
let mut ret = [opcodes::all::OP_NOP.into_u8(); 136];
1760-
ret[131] = opcodes::all::OP_DROP.into_u8();
1761-
ret[132] = opcodes::all::OP_DROP.into_u8();
1762-
ret[133] = opcodes::all::OP_DROP.into_u8();
1763-
ret[134] = opcodes::all::OP_DROP.into_u8();
1764-
ret[135] = opcodes::OP_TRUE.into_u8();
1759+
let mut ret = [opcodes::all::OP_NOP.to_u8(); 136];
1760+
ret[131] = opcodes::all::OP_DROP.to_u8();
1761+
ret[132] = opcodes::all::OP_DROP.to_u8();
1762+
ret[133] = opcodes::all::OP_DROP.to_u8();
1763+
ret[134] = opcodes::all::OP_DROP.to_u8();
1764+
ret[135] = opcodes::OP_TRUE.to_u8();
17651765
Vec::from(&ret[..])
17661766
}
17671767

@@ -2110,7 +2110,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
21102110
};
21112111
}
21122112

2113-
let commitment_number = 0xffffffffffff - ((((tx.input[0].sequence as u64 & 0xffffff) << 3*8) | (tx.lock_time as u64 & 0xffffff)) ^ self.commitment_transaction_number_obscure_factor);
2113+
let commitment_number = 0xffffffffffff - ((((tx.input[0].sequence.0 as u64 & 0xffffff) << 3*8) | (tx.lock_time.0 as u64 & 0xffffff)) ^ self.commitment_transaction_number_obscure_factor);
21142114
if commitment_number >= self.get_min_seen_secret() {
21152115
let secret = self.get_secret(commitment_number).unwrap();
21162116
let per_commitment_key = ignore_error!(SecretKey::from_slice(&secret));
@@ -2495,7 +2495,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
24952495
log_info!(logger, "Channel {} closed by funding output spend in txid {}.",
24962496
log_bytes!(self.funding_info.0.to_channel_id()), tx.txid());
24972497
self.funding_spend_seen = true;
2498-
if (tx.input[0].sequence >> 8*3) as u8 == 0x80 && (tx.lock_time >> 8*3) as u8 == 0x20 {
2498+
if (tx.input[0].sequence.0 >> 8*3) as u8 == 0x80 && (tx.lock_time.0 >> 8*3) as u8 == 0x20 {
24992499
let (mut new_outpoints, new_outputs) = self.check_spend_counterparty_transaction(&tx, height, &logger);
25002500
if !new_outputs.1.is_empty() {
25012501
watch_outputs.push(new_outputs);
@@ -3469,7 +3469,7 @@ mod tests {
34693469
use util::ser::{ReadableArgs, Writeable};
34703470
use sync::{Arc, Mutex};
34713471
use io;
3472-
use bitcoin::Witness;
3472+
use bitcoin::{PackedLockTime, Sequence, TxMerkleNode, Witness};
34733473
use prelude::*;
34743474

34753475
fn do_test_funding_spend_refuses_updates(use_local_txn: bool) {
@@ -3513,7 +3513,7 @@ mod tests {
35133513
let new_header = BlockHeader {
35143514
version: 2, time: 0, bits: 0, nonce: 0,
35153515
prev_blockhash: nodes[0].best_block_info().0,
3516-
merkle_root: Default::default() };
3516+
merkle_root: TxMerkleNode::all_zeros() };
35173517
let conf_height = nodes[0].best_block_info().1 + 1;
35183518
nodes[1].chain_monitor.chain_monitor.transactions_confirmed(&new_header,
35193519
&[(0, broadcast_tx)], conf_height);
@@ -3573,7 +3573,7 @@ mod tests {
35733573
let fee_estimator = TestFeeEstimator { sat_per_kw: Mutex::new(253) };
35743574

35753575
let dummy_key = PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[42; 32]).unwrap());
3576-
let dummy_tx = Transaction { version: 0, lock_time: 0, input: Vec::new(), output: Vec::new() };
3576+
let dummy_tx = Transaction { version: 0, lock_time: PackedLockTime::ZERO, input: Vec::new(), output: Vec::new() };
35773577

35783578
let mut preimages = Vec::new();
35793579
{
@@ -3639,7 +3639,7 @@ mod tests {
36393639
delayed_payment_basepoint: PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[47; 32]).unwrap()),
36403640
htlc_basepoint: PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[48; 32]).unwrap())
36413641
};
3642-
let funding_outpoint = OutPoint { txid: Default::default(), index: u16::max_value() };
3642+
let funding_outpoint = OutPoint { txid: Txid::all_zeros(), index: u16::max_value() };
36433643
let channel_parameters = ChannelTransactionParameters {
36443644
holder_pubkeys: keys.holder_channel_pubkeys.clone(),
36453645
holder_selected_contest_delay: 66,
@@ -3753,7 +3753,7 @@ mod tests {
37533753

37543754
// Justice tx with 1 to_holder, 2 revoked offered HTLCs, 1 revoked received HTLCs
37553755
for &opt_anchors in [false, true].iter() {
3756-
let mut claim_tx = Transaction { version: 0, lock_time: 0, input: Vec::new(), output: Vec::new() };
3756+
let mut claim_tx = Transaction { version: 0, lock_time: PackedLockTime::ZERO, input: Vec::new(), output: Vec::new() };
37573757
let mut sum_actual_sigs = 0;
37583758
for i in 0..4 {
37593759
claim_tx.input.push(TxIn {
@@ -3762,7 +3762,7 @@ mod tests {
37623762
vout: i,
37633763
},
37643764
script_sig: Script::new(),
3765-
sequence: 0xfffffffd,
3765+
sequence: Sequence::ENABLE_RBF_NO_LOCKTIME,
37663766
witness: Witness::new(),
37673767
});
37683768
}
@@ -3785,7 +3785,7 @@ mod tests {
37853785

37863786
// Claim tx with 1 offered HTLCs, 3 received HTLCs
37873787
for &opt_anchors in [false, true].iter() {
3788-
let mut claim_tx = Transaction { version: 0, lock_time: 0, input: Vec::new(), output: Vec::new() };
3788+
let mut claim_tx = Transaction { version: 0, lock_time: PackedLockTime::ZERO, input: Vec::new(), output: Vec::new() };
37893789
let mut sum_actual_sigs = 0;
37903790
for i in 0..4 {
37913791
claim_tx.input.push(TxIn {
@@ -3794,7 +3794,7 @@ mod tests {
37943794
vout: i,
37953795
},
37963796
script_sig: Script::new(),
3797-
sequence: 0xfffffffd,
3797+
sequence: Sequence::ENABLE_RBF_NO_LOCKTIME,
37983798
witness: Witness::new(),
37993799
});
38003800
}
@@ -3817,15 +3817,15 @@ mod tests {
38173817

38183818
// Justice tx with 1 revoked HTLC-Success tx output
38193819
for &opt_anchors in [false, true].iter() {
3820-
let mut claim_tx = Transaction { version: 0, lock_time: 0, input: Vec::new(), output: Vec::new() };
3820+
let mut claim_tx = Transaction { version: 0, lock_time: PackedLockTime::ZERO, input: Vec::new(), output: Vec::new() };
38213821
let mut sum_actual_sigs = 0;
38223822
claim_tx.input.push(TxIn {
38233823
previous_output: BitcoinOutPoint {
38243824
txid,
38253825
vout: 0,
38263826
},
38273827
script_sig: Script::new(),
3828-
sequence: 0xfffffffd,
3828+
sequence: Sequence::ENABLE_RBF_NO_LOCKTIME,
38293829
witness: Witness::new(),
38303830
});
38313831
claim_tx.output.push(TxOut {

0 commit comments

Comments
 (0)