From: Arik Sosman Date: Thu, 15 Aug 2024 06:57:14 +0000 (-0700) Subject: Fix fuzz warnings. X-Git-Tag: v0.0.124-beta~9^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=36b484a720398bb55e95180176830dc0c3cf059f;p=rust-lightning Fix fuzz 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. --- diff --git a/fuzz/src/chanmon_consistency.rs b/fuzz/src/chanmon_consistency.rs index 1cdd3ff12..361dae2b1 100644 --- a/fuzz/src/chanmon_consistency.rs +++ b/fuzz/src/chanmon_consistency.rs @@ -880,7 +880,7 @@ pub fn do_test(data: &[u8], underlying_out: Out, anchors: bool) { script_pubkey: output_script, }], }; - funding_output = OutPoint { txid: tx.txid(), index: 0 }; + funding_output = OutPoint { txid: tx.compute_txid(), index: 0 }; $source .funding_transaction_generated( temporary_channel_id, diff --git a/fuzz/src/full_stack.rs b/fuzz/src/full_stack.rs index 97cfe631d..580df1b05 100644 --- a/fuzz/src/full_stack.rs +++ b/fuzz/src/full_stack.rs @@ -306,7 +306,7 @@ impl<'a> MoneyLossDetector<'a> { fn connect_block(&mut self, all_txn: &[Transaction]) { let mut txdata = Vec::with_capacity(all_txn.len()); for (idx, tx) in all_txn.iter().enumerate() { - let txid = tx.txid(); + let txid = tx.compute_txid(); self.txids_confirmed.entry(txid).or_insert_with(|| { txdata.push((idx + 1, tx)); self.height @@ -898,7 +898,7 @@ pub fn do_test(mut data: &[u8], logger: &Arc) { if tx.version.0 > 0xff { break; } - let funding_txid = tx.txid(); + let funding_txid = tx.compute_txid(); if loss_detector.txids_confirmed.get(&funding_txid).is_none() { let outpoint = OutPoint { txid: funding_txid, index: 0 }; for chan in channelmanager.list_channels() { @@ -923,7 +923,7 @@ pub fn do_test(mut data: &[u8], logger: &Arc) { panic!(); } } - let funding_txid = tx.txid(); + let funding_txid = tx.compute_txid(); for idx in 0..tx.output.len() { let outpoint = OutPoint { txid: funding_txid, index: idx as u16 }; pending_funding_signatures.insert(outpoint, tx.clone());