Add a new test for 0conf-with-monitor-update-failures
[rust-lightning] / lightning / src / util / test_utils.rs
index 3682a0e8f0af02d1ac654853bff16e3096f4025a..1d4eccd81e6678ebf207daeda35681887824d89f 100644 (file)
@@ -116,6 +116,11 @@ impl<'a> TestChainMonitor<'a> {
                        expect_channel_force_closed: Mutex::new(None),
                }
        }
+
+       pub fn complete_sole_pending_chan_update(&self, channel_id: &[u8; 32]) {
+               let (outpoint, _, latest_update) = self.latest_monitor_update_id.lock().unwrap().get(channel_id).unwrap().clone();
+               self.chain_monitor.channel_monitor_updated(outpoint, latest_update).unwrap();
+       }
 }
 impl<'a> chain::Watch<EnforcingSigner> for TestChainMonitor<'a> {
        fn watch_channel(&self, funding_txo: OutPoint, monitor: channelmonitor::ChannelMonitor<EnforcingSigner>) -> Result<(), chain::ChannelMonitorUpdateErr> {