nodes[0].node.funding_transaction_generated(&temporary_channel_id, &nodes[1].node.get_our_node_id(), tx.clone()).unwrap();
check_added_monitors(&nodes[0], 0);
- {
- let events = nodes[0].node.get_and_clear_pending_msg_events();
- let n = events.len();
- assert_eq!(n, 0, "expected no events generated from nodes[0], found {}", n);
- }
+ assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
// Now re-enable the signer and simulate a retry. The temporary_channel_id won't work anymore so
// we have to dig out the real channel ID.
nodes[1].node.handle_funding_created(&nodes[0].node.get_our_node_id(), &funding_created_msg);
check_added_monitors(&nodes[1], 1);
- {
- let events = nodes[1].node.get_and_clear_pending_msg_events();
- let n = events.len();
- assert_eq!(n, 0, "expected no events generated from nodes[1], found {}", n);
- }
+ assert!(nodes[1].node.get_and_clear_pending_msg_events().is_empty());
// Now re-enable the signer and simulate a retry. The temporary_channel_id won't work anymore so
// we have to dig out the real channel ID.
let per_peer_state = nodes[0].node.per_peer_state.read().unwrap();
let chan_lock = per_peer_state.get(&nodes[1].node.get_our_node_id()).unwrap().lock().unwrap();
let chan_ids = chan_lock.channel_by_id.keys().collect::<Vec<_>>();
- let n = chan_ids.len();
- assert_eq!(n, 1, "expected one channel, not {}", n);
+ assert_eq!(chan_ids.len(), 1, "expected one channel, not {}", chan_ids.len());
*chan_ids[0]
};
dst.node.signer_unblocked(Some((src.node.get_our_node_id(), chan_id)));
let events = dst.node.get_and_clear_pending_msg_events();
- let n = events.len();
- assert_eq!(n, 1, "expected one message, got {}", n);
+ assert_eq!(events.len(), 1, "expected one message, got {}", events.len());
if let MessageSendEvent::UpdateHTLCs { ref node_id, .. } = events[0] {
assert_eq!(node_id, &src.node.get_our_node_id());
} else {
nodes[1].node.handle_funding_created(&nodes[0].node.get_our_node_id(), &funding_created_msg);
check_added_monitors(&nodes[1], 1);
- {
- let events = nodes[1].node.get_and_clear_pending_msg_events();
- let n = events.len();
- assert_eq!(n, 0, "expected no events generated from nodes[1], found {}", n);
- }
+ assert!(nodes[1].node.get_and_clear_pending_msg_events().is_empty());
// Now re-enable the signer and simulate a retry. The temporary_channel_id won't work anymore so
// we have to dig out the real channel ID.
let per_peer_state = nodes[0].node.per_peer_state.read().unwrap();
let chan_lock = per_peer_state.get(&nodes[1].node.get_our_node_id()).unwrap().lock().unwrap();
let chan_ids = chan_lock.channel_by_id.keys().collect::<Vec<_>>();
- let n = chan_ids.len();
- assert_eq!(n, 1, "expected one channel, not {}", n);
+ assert_eq!(chan_ids.len(), 1, "expected one channel, not {}", chan_ids.len());
*chan_ids[0]
};
{
let events = dst.node.get_and_clear_pending_msg_events();
- let n = events.len();
- assert_eq!(n, 1, "expected one message, got {}", n);
+ assert_eq!(events.len(), 1, "expected one message, got {}", events.len());
if let MessageSendEvent::UpdateHTLCs { ref node_id, .. } = events[0] {
assert_eq!(node_id, &src.node.get_our_node_id());
} else {