X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=fuzz%2Fsrc%2Frouter.rs;h=2a36d890936790dc1367ce2cc090c3cd16062cf1;hb=2d6d5cc86f688fad01caca8ff420a10a6f01b726;hp=ad4373c4793bc704f66d6cc095b83a5e82013cf7;hpb=eaf76f6cceefdc08202d7fe08e4760df0e824d38;p=rust-lightning diff --git a/fuzz/src/router.rs b/fuzz/src/router.rs index ad4373c4..2a36d890 100644 --- a/fuzz/src/router.rs +++ b/fuzz/src/router.rs @@ -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 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)), @@ -243,7 +245,7 @@ pub fn do_test(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(), }); @@ -363,7 +365,7 @@ pub fn do_test(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, })