Add arg to get_route to specify our local channels explicitly
[rust-lightning] / fuzz / fuzz_targets / full_stack_target.rs
index 4ae9be413b81ad83c19d7893fb58254309e5a17a..0649794c02ec25675f8c171d88e51a6b25083289 100644 (file)
@@ -9,12 +9,12 @@ use bitcoin::blockdata::script::Script;
 use bitcoin::network::constants::Network;
 use bitcoin::network::serialize::{serialize, BitcoinHash};
 use bitcoin::util::hash::Sha256dHash;
-use bitcoin::util::uint::Uint256;
 
 use crypto::sha2::Sha256;
 use crypto::digest::Digest;
 
 use lightning::chain::chaininterface::{BroadcasterInterface,ConfirmationTarget,ChainListener,FeeEstimator,ChainWatchInterfaceUtil};
+use lightning::chain::transaction::OutPoint;
 use lightning::ln::channelmonitor;
 use lightning::ln::channelmanager::ChannelManager;
 use lightning::ln::peer_handler::{MessageHandler,PeerManager,SocketDescriptor};
@@ -93,7 +93,7 @@ impl FeeEstimator for FuzzEstimator {
 
 struct TestChannelMonitor {}
 impl channelmonitor::ManyChannelMonitor for TestChannelMonitor {
-       fn add_update_monitor(&self, _funding_txo: (Sha256dHash, u16), _monitor: channelmonitor::ChannelMonitor) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
+       fn add_update_monitor(&self, _funding_txo: OutPoint, _monitor: channelmonitor::ChannelMonitor) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
                //TODO!
                Ok(())
        }
@@ -167,7 +167,7 @@ pub fn do_test(data: &[u8]) {
        let mut should_forward = false;
        let mut payments_received = Vec::new();
        let mut payments_sent = 0;
-       let mut pending_funding_generation: Vec<(Uint256, u64, Script)> = Vec::new();
+       let mut pending_funding_generation: Vec<([u8; 32], u64, Script)> = Vec::new();
        let mut pending_funding_signatures = HashMap::new();
        let mut pending_funding_relay = Vec::new();
 
@@ -213,7 +213,7 @@ pub fn do_test(data: &[u8]) {
                        },
                        4 => {
                                let value = slice_to_be24(get_slice!(3)) as u64;
-                               let route = match router.get_route(&get_pubkey!(), &Vec::new(), value, 42) {
+                               let route = match router.get_route(&get_pubkey!(), None, &Vec::new(), value, 42) {
                                        Ok(route) => route,
                                        Err(_) => return,
                                };
@@ -280,7 +280,7 @@ pub fn do_test(data: &[u8]) {
                                        let mut tx = Transaction { version: 0, lock_time: 0, input: Vec::new(), output: vec![TxOut {
                                                        value: funding_generation.1, script_pubkey: funding_generation.2,
                                                }] };
-                                       let funding_output = (Sha256dHash::from_data(&serialize(&tx).unwrap()[..]), 0);
+                                       let funding_output = OutPoint::new(Sha256dHash::from_data(&serialize(&tx).unwrap()[..]), 0);
                                        channelmanager.funding_transaction_generated(&funding_generation.0, funding_output.clone());
                                        pending_funding_signatures.insert(funding_output, tx);
                                }