//! These tests work by standing up full nodes and route payments across the network, checking the
//! returned errors decode to the correct thing.
+use chain::channelmonitor::{CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS};
use ln::channelmanager::{HTLCForwardInfo, PaymentPreimage, PaymentHash};
-use ln::channelmonitor::{CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS};
use ln::onion_utils;
use routing::router::{Route, get_route};
use ln::features::InitFeatures;
txdata: vec![],
};
for ix in 0..nodes.len() {
- nodes[ix].block_notifier.block_connected(&block, 1);
+ connect_block(&nodes[ix], &block, 1);
}
macro_rules! expect_event {
use bitcoin::secp256k1::ffi::Signature as FFISignature;
use bitcoin::secp256k1::Signature;
msgs::ChannelUpdate {
- signature: Signature::from(FFISignature::new()),
+ signature: Signature::from(unsafe { FFISignature::new() }),
contents: msgs::UnsignedChannelUpdate {
chain_hash: BlockHash::hash(&vec![0u8][..]),
short_channel_id: 0,
let (_, payment_hash) = get_payment_preimage_hash!(nodes[0]);
let net_graph_msg_handler = &nodes[0].net_graph_msg_handler;
let logger = test_utils::TestLogger::new();
- let route = get_route(&nodes[0].node.get_our_node_id(), &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[2].node.get_our_node_id(), None, &Vec::new(), 40000, TEST_FINAL_CLTV, &logger).unwrap();
+ let route = get_route(&nodes[0].node.get_our_node_id(), &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[2].node.get_our_node_id(), None, None, &Vec::new(), 40000, TEST_FINAL_CLTV, &logger).unwrap();
// positve case
send_payment(&nodes[0], &vec!(&nodes[1], &nodes[2])[..], 40000, 40_000);
txdata: vec![],
};
- nodes[1].block_notifier.block_connected(&block, height);
+ connect_block(&nodes[1], &block, height);
}, ||{}, true, Some(UPDATE|14), Some(msgs::HTLCFailChannelUpdate::ChannelUpdateMessage{msg: ChannelUpdate::dummy()}));
run_onion_failure_test("unknown_payment_hash", 2, &nodes, &route, &payment_hash, |_| {}, || {
txdata: vec![],
};
- nodes[2].block_notifier.block_connected(&block, height);
+ connect_block(&nodes[2], &block, height);
}, || {}, true, Some(17), None);
run_onion_failure_test("final_incorrect_cltv_expiry", 1, &nodes, &route, &payment_hash, |_| {}, || {