X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Ffunctional_tests.rs;h=2f2c6482cb873a823005e917a81280cb1e31c86a;hb=f3a5a72346e72ade92acfecbb696c7028b649949;hp=fb9ce86234c90b91de765cfe6d714bc08b7fb128;hpb=62236c70d863bf9456e28a3a1ba784b2e4680a88;p=rust-lightning diff --git a/lightning/src/ln/functional_tests.rs b/lightning/src/ln/functional_tests.rs index fb9ce862..2f2c6482 100644 --- a/lightning/src/ln/functional_tests.rs +++ b/lightning/src/ln/functional_tests.rs @@ -23,7 +23,7 @@ use ln::channel::{commitment_tx_base_weight, COMMITMENT_TX_WEIGHT_PER_HTLC, CONC use ln::channelmanager::{ChannelManager, ChannelManagerReadArgs, PaymentId, RAACommitmentOrder, PaymentSendFailure, BREAKDOWN_TIMEOUT, MIN_CLTV_EXPIRY_DELTA, PAYMENT_EXPIRY_BLOCKS }; use ln::channel::{Channel, ChannelError}; use ln::{chan_utils, onion_utils}; -use ln::chan_utils::{htlc_success_tx_weight, htlc_timeout_tx_weight, HTLCOutputInCommitment}; +use ln::chan_utils::{OFFERED_HTLC_SCRIPT_WEIGHT, htlc_success_tx_weight, htlc_timeout_tx_weight, HTLCOutputInCommitment}; use routing::gossip::{NetworkGraph, NetworkUpdate}; use routing::router::{PaymentParameters, Route, RouteHop, RouteParameters, find_route, get_route}; use ln::features::{ChannelFeatures, InitFeatures, InvoiceFeatures, NodeFeatures}; @@ -9518,10 +9518,7 @@ fn test_invalid_funding_tx() { // a panic as we'd try to extract a 32 byte preimage from a witness element without checking // its length. let mut wit_program: Vec = channelmonitor::deliberately_bogus_accepted_htlc_witness_program(); - assert!(chan_utils::HTLCType::scriptlen_to_htlctype(wit_program.len()).unwrap() == - chan_utils::HTLCType::AcceptedHTLC); - - let wit_program_script: Script = wit_program.clone().into(); + let wit_program_script: Script = wit_program.into(); for output in tx.output.iter_mut() { // Make the confirmed funding transaction have a bogus script_pubkey output.script_pubkey = Script::new_v0_p2wsh(&wit_program_script.wscript_hash());