From 813202f5544d9b4fbbf2437af0ae8a4e31d0a6d7 Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Wed, 14 Aug 2024 13:41:55 -0700 Subject: [PATCH] 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. --- lightning-background-processor/src/lib.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lightning-background-processor/src/lib.rs b/lightning-background-processor/src/lib.rs index 3b01fb595..5dee91f5f 100644 --- a/lightning-background-processor/src/lib.rs +++ b/lightning-background-processor/src/lib.rs @@ -1866,7 +1866,10 @@ mod tests { nodes[0] .node .force_close_broadcasting_latest_txn( - &ChannelId::v1_from_funding_outpoint(OutPoint { txid: tx.txid(), index: 0 }), + &ChannelId::v1_from_funding_outpoint(OutPoint { + txid: tx.compute_txid(), + index: 0, + }), &nodes[1].node.get_our_node_id(), error_message.to_string(), ) @@ -2134,7 +2137,7 @@ mod tests { get_event_msg!(nodes[1], MessageSendEvent::SendChannelUpdate, node_0_id); let broadcast_funding = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().pop().unwrap(); - assert_eq!(broadcast_funding.txid(), funding_tx.txid()); + assert_eq!(broadcast_funding.compute_txid(), funding_tx.compute_txid()); assert!(nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().is_empty()); if !std::thread::panicking() { @@ -2212,7 +2215,7 @@ mod tests { let sweep_tx_0 = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().pop().unwrap(); match tracked_output.status { OutputSpendStatus::PendingFirstConfirmation { latest_spending_tx, .. } => { - assert_eq!(sweep_tx_0.txid(), latest_spending_tx.txid()); + assert_eq!(sweep_tx_0.compute_txid(), latest_spending_tx.compute_txid()); }, _ => panic!("Unexpected status"), } @@ -2224,7 +2227,7 @@ mod tests { let sweep_tx_1 = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().pop().unwrap(); match tracked_output.status { OutputSpendStatus::PendingFirstConfirmation { latest_spending_tx, .. } => { - assert_eq!(sweep_tx_1.txid(), latest_spending_tx.txid()); + assert_eq!(sweep_tx_1.compute_txid(), latest_spending_tx.compute_txid()); }, _ => panic!("Unexpected status"), } @@ -2236,7 +2239,7 @@ mod tests { let sweep_tx_2 = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().pop().unwrap(); match tracked_output.status { OutputSpendStatus::PendingFirstConfirmation { latest_spending_tx, .. } => { - assert_eq!(sweep_tx_2.txid(), latest_spending_tx.txid()); + assert_eq!(sweep_tx_2.compute_txid(), latest_spending_tx.compute_txid()); }, _ => panic!("Unexpected status"), } @@ -2249,7 +2252,7 @@ mod tests { let tracked_output = nodes[0].sweeper.tracked_spendable_outputs().first().unwrap().clone(); match tracked_output.status { OutputSpendStatus::PendingThresholdConfirmations { latest_spending_tx, .. } => { - assert_eq!(sweep_tx_2.txid(), latest_spending_tx.txid()); + assert_eq!(sweep_tx_2.compute_txid(), latest_spending_tx.compute_txid()); }, _ => panic!("Unexpected status"), } @@ -2264,7 +2267,7 @@ mod tests { let tracked_output = nodes[0].sweeper.tracked_spendable_outputs().first().unwrap().clone(); match tracked_output.status { OutputSpendStatus::PendingThresholdConfirmations { latest_spending_tx, .. } => { - assert_eq!(sweep_tx_2.txid(), latest_spending_tx.txid()); + assert_eq!(sweep_tx_2.compute_txid(), latest_spending_tx.compute_txid()); }, _ => panic!("Unexpected status"), } -- 2.39.5