Skip to content

Commit 7221708

Browse files
committed
f make test pass after rebase
1 parent 9361415 commit 7221708

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ fn test_monitor_and_persister_update_fail() {
9393
let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
9494
assert_eq!(updates.update_fulfill_htlcs.len(), 1);
9595
nodes[0].node.handle_update_fulfill_htlc(&nodes[1].node.get_our_node_id(), &updates.update_fulfill_htlcs[0]);
96+
9697
{
9798
let mut node_0_per_peer_lock;
9899
let mut node_0_peer_state_lock;
@@ -102,15 +103,19 @@ fn test_monitor_and_persister_update_fail() {
102103
// as the monitor update errors.
103104
if let ChannelMonitorUpdateStatus::InProgress = chain_mon.chain_monitor.update_channel(outpoint, &update) {} else { panic!("Expected monitor paused"); }
104105
logger.assert_log_regex("lightning::chain::chainmonitor", regex::Regex::new("Failed to update ChannelMonitor for channel [0-9a-f]*.").unwrap(), 1);
106+
107+
// Apply the montior update to the original ChainMonitor, ensuring the
108+
// ChannelManager and ChannelMonitor aren't out of sync.
109+
assert_eq!(nodes[0].chain_monitor.update_channel(outpoint, &update),
110+
ChannelMonitorUpdateStatus::Completed);
105111
} else { assert!(false); }
106112
} else {
107113
assert!(false);
108114
}
109115
}
110116

111117
check_added_monitors!(nodes[0], 1);
112-
let events = nodes[0].node.get_and_clear_pending_events();
113-
assert_eq!(events.len(), 1);
118+
expect_payment_sent(&nodes[0], preimage, None, false, false);
114119
}
115120

116121
fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {

0 commit comments

Comments
 (0)