X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=fuzz%2Fsrc%2Futils%2Ftest_persister.rs;h=44675fa787294b4a63144c9a2cddfacc4b9b33a6;hb=2fda791d5c36863ca69b290c9293db2fe0d35a25;hp=0bd60911efe84afc4ca05f028d7a936106934494;hpb=23a1d7aab5c2cc6f00636815fa126716456dfcfd;p=rust-lightning diff --git a/fuzz/src/utils/test_persister.rs b/fuzz/src/utils/test_persister.rs index 0bd60911..44675fa7 100644 --- a/fuzz/src/utils/test_persister.rs +++ b/fuzz/src/utils/test_persister.rs @@ -1,14 +1,20 @@ -use lightning::chain::channelmonitor; +use lightning::chain; +use lightning::chain::{chainmonitor, channelmonitor}; +use lightning::chain::chainmonitor::MonitorUpdateId; use lightning::chain::transaction::OutPoint; -use lightning::util::enforcing_trait_impls::EnforcingChannelKeys; +use lightning::util::enforcing_trait_impls::EnforcingSigner; -pub struct TestPersister {} -impl channelmonitor::Persist for TestPersister { - fn persist_new_channel(&self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> { - Ok(()) +use std::sync::Mutex; + +pub struct TestPersister { + pub update_ret: Mutex, +} +impl chainmonitor::Persist for TestPersister { + fn persist_new_channel(&self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor, _update_id: MonitorUpdateId) -> chain::ChannelMonitorUpdateStatus { + self.update_ret.lock().unwrap().clone() } - fn update_persisted_channel(&self, _funding_txo: OutPoint, _update: &channelmonitor::ChannelMonitorUpdate, _data: &channelmonitor::ChannelMonitor) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> { - Ok(()) + fn update_persisted_channel(&self, _funding_txo: OutPoint, _update: &Option, _data: &channelmonitor::ChannelMonitor, _update_id: MonitorUpdateId) -> chain::ChannelMonitorUpdateStatus { + self.update_ret.lock().unwrap().clone() } }