Skip to content

Commit f4a70e6

Browse files
committed
f add some test comments
1 parent b7b895c commit f4a70e6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lightning/src/ln/reorg_tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ fn do_test_unconf_chan(reload_node: bool, reorg_after_reload: bool) {
278278
}
279279
}
280280

281+
// With expect_channel_force_closed set the TestChainMonitor will enforce that the next update
282+
// is a ChannelForcClosed on the right channel with should_broadcast set.
281283
*nodes[0].chain_monitor.expect_channel_force_closed.lock().unwrap() = Some((chan_id, true));
282284
nodes[0].node.test_process_background_events(); // Required to free the pending background monitor update
283285
check_added_monitors!(nodes[0], 1);

lightning/src/util/test_utils.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,12 @@ pub struct TestChainMonitor<'a> {
8282
pub chain_monitor: chainmonitor::ChainMonitor<EnforcingSigner, &'a TestChainSource, &'a chaininterface::BroadcasterInterface, &'a TestFeeEstimator, &'a TestLogger, &'a channelmonitor::Persist<EnforcingSigner>>,
8383
pub keys_manager: &'a TestKeysInterface,
8484
pub update_ret: Mutex<Option<Result<(), channelmonitor::ChannelMonitorUpdateErr>>>,
85-
// If this is set to Some(), after the next return, we'll always return this until update_ret
86-
// is changed:
85+
/// If this is set to Some(), after the next return, we'll always return this until update_ret
86+
/// is changed:
8787
pub next_update_ret: Mutex<Option<Result<(), channelmonitor::ChannelMonitorUpdateErr>>>,
88+
/// If this is set to Some(), the next update_channel call (not watch_channel) must be a
89+
/// ChannelForceClosed event for the given channel_id with should_broadcast set to the given
90+
/// boolean.
8891
pub expect_channel_force_closed: Mutex<Option<([u8; 32], bool)>>,
8992
}
9093
impl<'a> TestChainMonitor<'a> {

0 commit comments

Comments
 (0)