X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Ffunctional_test_utils.rs;h=3c84cff5b1a418e13c1896d888361fd742d81e2e;hb=6de175575b6cd3e4f087a123a6dd699c9ec8ef00;hp=001da7009b8a67e05ff22ae9719da7ce869434b9;hpb=283d40f2e41f6ee984a7f802200acf3482e6193f;p=rust-lightning diff --git a/src/ln/functional_test_utils.rs b/src/ln/functional_test_utils.rs index 001da7009..3c84cff5b 100644 --- a/src/ln/functional_test_utils.rs +++ b/src/ln/functional_test_utils.rs @@ -29,8 +29,6 @@ use secp256k1::key::PublicKey; use rand::{thread_rng,Rng}; use std::cell::RefCell; -use std::collections::HashMap; -use std::default::Default; use std::rc::Rc; use std::sync::{Arc, Mutex}; use std::mem; @@ -307,10 +305,13 @@ pub fn create_announced_chan_between_nodes_with_value(nodes: &Vec, a: usiz macro_rules! check_spends { ($tx: expr, $spends_tx: expr) => { { - let mut funding_tx_map = HashMap::new(); - let spends_tx = $spends_tx; - funding_tx_map.insert(spends_tx.txid(), spends_tx); - $tx.verify(&funding_tx_map).unwrap(); + $tx.verify(|out_point| { + if out_point.txid == $spends_tx.txid() { + $spends_tx.output.get(out_point.vout as usize).cloned() + } else { + None + } + }).unwrap(); } } } @@ -740,7 +741,7 @@ pub fn route_over_limit(origin_node: &Node, expected_route: &[&Node], recv_value let err = origin_node.node.send_payment(route, our_payment_hash).err().unwrap(); match err { - APIError::ChannelUnavailable{err} => assert_eq!(err, "Cannot send value that would put us over the max HTLC value in flight"), + APIError::ChannelUnavailable{err} => assert_eq!(err, "Cannot send value that would put us over the max HTLC value in flight our peer will accept"), _ => panic!("Unknown error variants"), }; }