]> git.bitcoin.ninja Git - rust-lightning/commitdiff
(Very) marginally expand `test_monitor_update_fail_claim` 2024-06-preimage-removal-blocked-by-claim-event
authorMatt Corallo <git@bluematt.me>
Thu, 13 Jun 2024 18:59:51 +0000 (18:59 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 18 Jun 2024 17:59:12 +0000 (17:59 +0000)
For some reason I wasn't sure this happened yet, so making the
test for no-`PaymentClaimed`-event-before-preimage-on-disk explicit
is nice.

lightning/src/ln/chanmon_update_fail_tests.rs

index 493607639f5e9d15935c192b1f83cdddbb004e82..ce07cb73713aff10e222a4a55775b2edbcd7bcf6 100644 (file)
@@ -1612,7 +1612,10 @@ fn test_monitor_update_fail_claim() {
        let (payment_preimage_1, payment_hash_1, ..) = route_payment(&nodes[0], &[&nodes[1]], 1_000_000);
 
        chanmon_cfgs[1].persister.set_update_ret(ChannelMonitorUpdateStatus::InProgress);
+       // As long as the preimage isn't on-chain, we shouldn't expose the `PaymentClaimed` event to
+       // users nor send the preimage to peers in the new commitment update.
        nodes[1].node.claim_funds(payment_preimage_1);
+       assert!(nodes[1].node.get_and_clear_pending_events().is_empty());
        assert!(nodes[1].node.get_and_clear_pending_msg_events().is_empty());
        check_added_monitors!(nodes[1], 1);