Move the public path for `channel_state` types to their new path
[rust-lightning] / fuzz / src / router.rs
index bf94c910531573335f2db2594ce1df41304b0f3d..2a36d890936790dc1367ce2cc090c3cd16062cf1 100644 (file)
@@ -7,14 +7,16 @@
 // You may not use this file except in accordance with one or both of these
 // licenses.
 
+use bitcoin::amount::Amount;
 use bitcoin::blockdata::constants::ChainHash;
 use bitcoin::blockdata::script::Builder;
 use bitcoin::blockdata::transaction::TxOut;
 
-use lightning::blinded_path::{BlindedHop, BlindedPath};
+use lightning::blinded_path::{BlindedHop, BlindedPath, IntroductionNode};
 use lightning::chain::transaction::OutPoint;
 use lightning::ln::ChannelId;
-use lightning::ln::channelmanager::{self, ChannelDetails, ChannelCounterparty};
+use lightning::ln::channel_state::{ChannelDetails, ChannelCounterparty, ChannelShutdownState};
+use lightning::ln::channelmanager;
 use lightning::ln::features::{BlindedHopFeatures, Bolt12InvoiceFeatures};
 use lightning::ln::msgs;
 use lightning::offers::invoice::BlindedPayInfo;
@@ -28,7 +30,7 @@ use lightning::util::ser::Readable;
 
 use bitcoin::hashes::Hash;
 use bitcoin::secp256k1::PublicKey;
-use bitcoin::network::constants::Network;
+use bitcoin::network::Network;
 
 use crate::utils::test_logger;
 
@@ -94,8 +96,8 @@ impl<Out: test_logger::Output> UtxoLookup for FuzzChainSource<'_, '_, Out> {
                if input_slice.is_none() { return UtxoResult::Sync(Err(UtxoLookupError::UnknownTx)); }
                let input_slice = input_slice.unwrap();
                let txo_res = TxOut {
-                       value: if input_slice[0] % 2 == 0 { 1_000_000 } else { 1_000 },
-                       script_pubkey: Builder::new().push_int(input_slice[1] as i64).into_script().to_v0_p2wsh(),
+                       value: Amount::from_sat(if input_slice[0] % 2 == 0 { 1_000_000 } else { 1_000 }),
+                       script_pubkey: Builder::new().push_int(input_slice[1] as i64).into_script().to_p2wsh(),
                };
                match input_slice {
                        &[0, _] => UtxoResult::Sync(Err(UtxoLookupError::UnknownChain)),
@@ -157,6 +159,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
                                        msgs::DecodeError::ShortRead => panic!("We picked the length..."),
                                        msgs::DecodeError::Io(e) => panic!("{:?}", e),
                                        msgs::DecodeError::UnsupportedCompression => return,
+                                       msgs::DecodeError::DangerousValue => return,
                                }
                        }
                }}
@@ -242,7 +245,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
                                                        inbound_htlc_maximum_msat: None,
                                                        config: None,
                                                        feerate_sat_per_1000_weight: None,
-                                                       channel_shutdown_state: Some(channelmanager::ChannelShutdownState::NotShuttingDown),
+                                                       channel_shutdown_state: Some(ChannelShutdownState::NotShuttingDown),
                                                        pending_inbound_htlcs: Vec::new(),
                                                        pending_outbound_htlcs: Vec::new(),
                                                });
@@ -362,7 +365,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
                                                });
                                        }
                                        (payinfo, BlindedPath {
-                                               introduction_node_id: hop.src_node_id,
+                                               introduction_node: IntroductionNode::NodeId(hop.src_node_id),
                                                blinding_point: dummy_pk,
                                                blinded_hops,
                                        })