- let events = nodes[0].node.get_and_clear_pending_events();
- assert_eq!(events.len(), 3);
- match events[0] {
- Event::PaymentSent { payment_hash, .. } => { // The payment was abandoned earlier, so the fee paid will be None
- assert_eq!(payment_hash, our_payment_hash);
- },
- _ => panic!("Unexpected event")
- }
- match events[1] {
- Event::PaymentPathSuccessful { payment_hash, .. } => {
- assert_eq!(payment_hash.unwrap(), our_payment_hash);
- },
- _ => panic!("Unexpected event")
- }
- match events[2] {
- Event::PaymentPathSuccessful { payment_hash, .. } => {
- assert_eq!(payment_hash.unwrap(), our_payment_hash);
- },
- _ => panic!("Unexpected event")
- }
+ expect_payment_sent(&nodes[0], our_payment_preimage, Some(None), true);