{
let mut channel_monitors = HashMap::new();
for monitor in deserialized_monitors.iter_mut() {
- channel_monitors.insert(monitor.get_funding_txo().unwrap(), monitor);
+ channel_monitors.insert(monitor.get_funding_txo(), monitor);
}
let mut w = test_utils::TestVecWriter(Vec::new());
let chain_watch = Arc::new(chaininterface::ChainWatchInterfaceUtil::new(Network::Testnet, Arc::clone(&self.logger) as Arc<Logger>));
let channel_monitor = test_utils::TestChannelMonitor::new(chain_watch.clone(), self.tx_broadcaster.clone(), self.logger.clone(), &feeest);
for deserialized_monitor in deserialized_monitors.drain(..) {
- if let Err(_) = channel_monitor.add_monitor(deserialized_monitor.get_funding_txo().unwrap(), deserialized_monitor) {
+ if let Err(_) = channel_monitor.add_monitor(deserialized_monitor.get_funding_txo(), deserialized_monitor) {
panic!();
}
}
let mut commitment_txn = None;
for (funding_txo, monitor) in monitors.iter_mut() {
if funding_txo.to_channel_id() == $channel_id {
- commitment_txn = Some(monitor.get_latest_local_commitment_txn());
+ commitment_txn = Some(monitor.unsafe_get_latest_local_commitment_txn());
break;
}
}
}
pub fn send_along_route_with_secret<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, route: Route, expected_paths: &[&[&Node<'a, 'b, 'c>]], recv_value: u64, our_payment_hash: PaymentHash, our_payment_secret: Option<PaymentSecret>) {
- origin_node.node.send_payment(route, our_payment_hash, &our_payment_secret).unwrap();
+ origin_node.node.send_payment(&route, our_payment_hash, &our_payment_secret).unwrap();
check_added_monitors!(origin_node, expected_paths.len());
let mut events = origin_node.node.get_and_clear_pending_msg_events();
}
let (_, our_payment_hash) = get_payment_preimage_hash!(origin_node);
- unwrap_send_err!(origin_node.node.send_payment(route, our_payment_hash, &None), true, APIError::ChannelUnavailable { err },
+ unwrap_send_err!(origin_node.node.send_payment(&route, our_payment_hash, &None), true, APIError::ChannelUnavailable { err },
assert_eq!(err, "Cannot send value that would put us over the max HTLC value in flight our peer will accept"));
}