- claim_payment_along_route(&nodes[0], &[&[&nodes[1], &nodes[3]], &[&nodes[2], &nodes[3]]], false, our_payment_preimage);
+ do_claim_payment_along_route(&nodes[0], &[&[&nodes[1], &nodes[3]], &[&nodes[2], &nodes[3]]], false, our_payment_preimage);
+ 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")
+ }