Skip to content

Commit fece28a

Browse files
committed
Use the TxOutRef type for the ChannelMonitor's funding_txo field.
Signed-off-by: Jean Pierre Dudey <[email protected]>
1 parent d8474c9 commit fece28a

File tree

6 files changed

+2847
-2842
lines changed

6 files changed

+2847
-2842
lines changed

fuzz/fuzz_targets/full_stack_target.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ extern crate lightning;
44
extern crate secp256k1;
55

66
use bitcoin::blockdata::block::BlockHeader;
7-
use bitcoin::blockdata::transaction::{Transaction, TxOut};
7+
use bitcoin::blockdata::transaction::{Transaction, TxOut, TxOutRef};
88
use bitcoin::blockdata::script::Script;
99
use bitcoin::network::constants::Network;
1010
use bitcoin::network::serialize::{serialize, BitcoinHash};
@@ -93,7 +93,7 @@ impl FeeEstimator for FuzzEstimator {
9393

9494
struct TestChannelMonitor {}
9595
impl channelmonitor::ManyChannelMonitor for TestChannelMonitor {
96-
fn add_update_monitor(&self, _funding_txo: (Sha256dHash, u16), _monitor: channelmonitor::ChannelMonitor) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
96+
fn add_update_monitor(&self, _funding_txo: TxOutRef, _monitor: channelmonitor::ChannelMonitor) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
9797
//TODO!
9898
Ok(())
9999
}
@@ -280,7 +280,10 @@ pub fn do_test(data: &[u8]) {
280280
let mut tx = Transaction { version: 0, lock_time: 0, input: Vec::new(), output: vec![TxOut {
281281
value: funding_generation.1, script_pubkey: funding_generation.2,
282282
}] };
283-
let funding_output = (Sha256dHash::from_data(&serialize(&tx).unwrap()[..]), 0);
283+
let funding_output = TxOutRef {
284+
txid: Sha256dHash::from_data(&serialize(&tx).unwrap()[..]),
285+
index: 0
286+
};
284287
channelmanager.funding_transaction_generated(&funding_generation.0, funding_output.clone());
285288
pending_funding_signatures.insert(funding_output, tx);
286289
}

0 commit comments

Comments
 (0)