]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Fix lightning-background-processor warnings.
authorArik Sosman <git@arik.io>
Wed, 14 Aug 2024 20:41:55 +0000 (13:41 -0700)
committerArik Sosman <git@arik.io>
Fri, 16 Aug 2024 17:31:45 +0000 (10:31 -0700)
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

index 3b01fb595c96a526e87c217f8d107e1cc759053c..5dee91f5ff2e6776eefd1235e5c01758df1f8140 100644 (file)
@@ -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"),
                }