Merge pull request #3107 from mhrheaume/mhr/closure_reason_abandoned
[rust-lightning] / fuzz / src / utils / test_persister.rs
index 4c18d8261399ba2dce4189dc80dfe43010eea3fb..7de3cc6bebb5252a3feaa25c8983d6060c3560c0 100644 (file)
@@ -1,20 +1,26 @@
 use lightning::chain;
-use lightning::chain::{chainmonitor, channelmonitor};
-use lightning::chain::chainmonitor::MonitorUpdateId;
 use lightning::chain::transaction::OutPoint;
-use lightning::util::enforcing_trait_impls::EnforcingSigner;
+use lightning::chain::{chainmonitor, channelmonitor};
+use lightning::util::test_channel_signer::TestChannelSigner;
 
 use std::sync::Mutex;
 
 pub struct TestPersister {
-       pub update_ret: Mutex<Result<(), chain::ChannelMonitorUpdateErr>>,
+       pub update_ret: Mutex<chain::ChannelMonitorUpdateStatus>,
 }
-impl chainmonitor::Persist<EnforcingSigner> for TestPersister {
-       fn persist_new_channel(&self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor<EnforcingSigner>, _update_id: MonitorUpdateId) -> Result<(), chain::ChannelMonitorUpdateErr> {
+impl chainmonitor::Persist<TestChannelSigner> for TestPersister {
+       fn persist_new_channel(
+               &self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor<TestChannelSigner>,
+       ) -> chain::ChannelMonitorUpdateStatus {
                self.update_ret.lock().unwrap().clone()
        }
 
-       fn update_persisted_channel(&self, _funding_txo: OutPoint, _update: &channelmonitor::ChannelMonitorUpdate, _data: &channelmonitor::ChannelMonitor<EnforcingSigner>, _update_id: MonitorUpdateId) -> Result<(), chain::ChannelMonitorUpdateErr> {
+       fn update_persisted_channel(
+               &self, _funding_txo: OutPoint, _update: Option<&channelmonitor::ChannelMonitorUpdate>,
+               _data: &channelmonitor::ChannelMonitor<TestChannelSigner>,
+       ) -> chain::ChannelMonitorUpdateStatus {
                self.update_ret.lock().unwrap().clone()
        }
+
+       fn archive_persisted_channel(&self, _: OutPoint) {}
 }