Skip to content

Commit 1c44d7e

Browse files
committed
Fix lightning-background-processor warnings.
Version 0.32.2 of `rust-bitcoin` deprecates a number of methods that are commonly used in this project, most visibly `txid()`, which is now called `compute_txid()`. This resulted in a lot of warnings, and this commit is part of a series that seeks to address that.
1 parent a621194 commit 1c44d7e

File tree

1 file changed

+10
-7
lines changed
  • lightning-background-processor/src

1 file changed

+10
-7
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,10 @@ mod tests {
18661866
nodes[0]
18671867
.node
18681868
.force_close_broadcasting_latest_txn(
1869-
&ChannelId::v1_from_funding_outpoint(OutPoint { txid: tx.txid(), index: 0 }),
1869+
&ChannelId::v1_from_funding_outpoint(OutPoint {
1870+
txid: tx.compute_txid(),
1871+
index: 0,
1872+
}),
18701873
&nodes[1].node.get_our_node_id(),
18711874
error_message.to_string(),
18721875
)
@@ -2134,7 +2137,7 @@ mod tests {
21342137
get_event_msg!(nodes[1], MessageSendEvent::SendChannelUpdate, node_0_id);
21352138
let broadcast_funding =
21362139
nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().pop().unwrap();
2137-
assert_eq!(broadcast_funding.txid(), funding_tx.txid());
2140+
assert_eq!(broadcast_funding.compute_txid(), funding_tx.compute_txid());
21382141
assert!(nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().is_empty());
21392142

21402143
if !std::thread::panicking() {
@@ -2212,7 +2215,7 @@ mod tests {
22122215
let sweep_tx_0 = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().pop().unwrap();
22132216
match tracked_output.status {
22142217
OutputSpendStatus::PendingFirstConfirmation { latest_spending_tx, .. } => {
2215-
assert_eq!(sweep_tx_0.txid(), latest_spending_tx.txid());
2218+
assert_eq!(sweep_tx_0.compute_txid(), latest_spending_tx.compute_txid());
22162219
},
22172220
_ => panic!("Unexpected status"),
22182221
}
@@ -2224,7 +2227,7 @@ mod tests {
22242227
let sweep_tx_1 = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().pop().unwrap();
22252228
match tracked_output.status {
22262229
OutputSpendStatus::PendingFirstConfirmation { latest_spending_tx, .. } => {
2227-
assert_eq!(sweep_tx_1.txid(), latest_spending_tx.txid());
2230+
assert_eq!(sweep_tx_1.compute_txid(), latest_spending_tx.compute_txid());
22282231
},
22292232
_ => panic!("Unexpected status"),
22302233
}
@@ -2236,7 +2239,7 @@ mod tests {
22362239
let sweep_tx_2 = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().pop().unwrap();
22372240
match tracked_output.status {
22382241
OutputSpendStatus::PendingFirstConfirmation { latest_spending_tx, .. } => {
2239-
assert_eq!(sweep_tx_2.txid(), latest_spending_tx.txid());
2242+
assert_eq!(sweep_tx_2.compute_txid(), latest_spending_tx.compute_txid());
22402243
},
22412244
_ => panic!("Unexpected status"),
22422245
}
@@ -2249,7 +2252,7 @@ mod tests {
22492252
let tracked_output = nodes[0].sweeper.tracked_spendable_outputs().first().unwrap().clone();
22502253
match tracked_output.status {
22512254
OutputSpendStatus::PendingThresholdConfirmations { latest_spending_tx, .. } => {
2252-
assert_eq!(sweep_tx_2.txid(), latest_spending_tx.txid());
2255+
assert_eq!(sweep_tx_2.compute_txid(), latest_spending_tx.compute_txid());
22532256
},
22542257
_ => panic!("Unexpected status"),
22552258
}
@@ -2264,7 +2267,7 @@ mod tests {
22642267
let tracked_output = nodes[0].sweeper.tracked_spendable_outputs().first().unwrap().clone();
22652268
match tracked_output.status {
22662269
OutputSpendStatus::PendingThresholdConfirmations { latest_spending_tx, .. } => {
2267-
assert_eq!(sweep_tx_2.txid(), latest_spending_tx.txid());
2270+
assert_eq!(sweep_tx_2.compute_txid(), latest_spending_tx.compute_txid());
22682271
},
22692272
_ => panic!("Unexpected status"),
22702273
}

0 commit comments

Comments
 (0)