Abandon payment on behalf of the user on payment path failure
[rust-lightning] / lightning / src / ln / monitor_tests.rs
index 088cf8661f8487b577a2a71e2a4b68f77236f7ea..c4435b470ca8c6deb8618fada682e9cd063fcc17 100644 (file)
@@ -1241,11 +1241,10 @@ fn do_test_revoked_counterparty_commitment_balances(confirm_htlc_spend_first: bo
        test_spendable_output(&nodes[1], &as_revoked_txn[0]);
 
        let mut payment_failed_events = nodes[1].node.get_and_clear_pending_events();
-       expect_payment_failed_conditions_event(&nodes[1], payment_failed_events.pop().unwrap(),
-               dust_payment_hash, false, PaymentFailedConditions::new());
-       expect_payment_failed_conditions_event(&nodes[1], payment_failed_events.pop().unwrap(),
+       expect_payment_failed_conditions_event(payment_failed_events[..2].to_vec(),
                missing_htlc_payment_hash, false, PaymentFailedConditions::new());
-       assert!(payment_failed_events.is_empty());
+       expect_payment_failed_conditions_event(payment_failed_events[2..].to_vec(),
+               dust_payment_hash, false, PaymentFailedConditions::new());
 
        connect_blocks(&nodes[1], 1);
        test_spendable_output(&nodes[1], &claim_txn[if confirm_htlc_spend_first { 2 } else { 3 }]);