- let mut next_msgs: Option<(msgs::UpdateFulfillHTLC, msgs::CommitmentSigned)> = None;
- let mut expected_next_node = expected_route.last().unwrap().node.get_our_node_id();
- macro_rules! get_next_msgs {
- ($node: expr) => {
- {
- let events = $node.node.get_and_clear_pending_msg_events();
- assert_eq!(events.len(), 1);
- match events[0] {
- MessageSendEvent::UpdateHTLCs { ref node_id, updates: msgs::CommitmentUpdate { ref update_add_htlcs, ref update_fulfill_htlcs, ref update_fail_htlcs, ref update_fail_malformed_htlcs, ref update_fee, ref commitment_signed } } => {
- assert!(update_add_htlcs.is_empty());
- assert_eq!(update_fulfill_htlcs.len(), 1);
- assert!(update_fail_htlcs.is_empty());
- assert!(update_fail_malformed_htlcs.is_empty());
- assert!(update_fee.is_none());
- expected_next_node = node_id.clone();
- Some((update_fulfill_htlcs[0].clone(), commitment_signed.clone()))
- },
- _ => panic!("Unexpected event"),
- }
+ macro_rules! msgs_from_ev {
+ ($ev: expr) => {
+ match $ev {
+ &MessageSendEvent::UpdateHTLCs { ref node_id, updates: msgs::CommitmentUpdate { ref update_add_htlcs, ref update_fulfill_htlcs, ref update_fail_htlcs, ref update_fail_malformed_htlcs, ref update_fee, ref commitment_signed } } => {
+ assert!(update_add_htlcs.is_empty());
+ assert_eq!(update_fulfill_htlcs.len(), 1);
+ assert!(update_fail_htlcs.is_empty());
+ assert!(update_fail_malformed_htlcs.is_empty());
+ assert!(update_fee.is_none());
+ ((update_fulfill_htlcs[0].clone(), commitment_signed.clone()), node_id.clone())
+ },
+ _ => panic!("Unexpected event"),