]> git.bitcoin.ninja Git - rust-lightning/blob - fuzz/src/utils/test_persister.rs
Add missing Offer::expects_quantity to tests
[rust-lightning] / fuzz / src / utils / test_persister.rs
1 use lightning::chain;
2 use lightning::chain::{chainmonitor, channelmonitor};
3 use lightning::chain::transaction::OutPoint;
4 use lightning::util::test_channel_signer::TestChannelSigner;
5
6 use std::sync::Mutex;
7
8 pub struct TestPersister {
9         pub update_ret: Mutex<chain::ChannelMonitorUpdateStatus>,
10 }
11 impl chainmonitor::Persist<TestChannelSigner> for TestPersister {
12         fn persist_new_channel(&self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor<TestChannelSigner>) -> chain::ChannelMonitorUpdateStatus {
13                 self.update_ret.lock().unwrap().clone()
14         }
15
16         fn update_persisted_channel(&self, _funding_txo: OutPoint, _update: Option<&channelmonitor::ChannelMonitorUpdate>, _data: &channelmonitor::ChannelMonitor<TestChannelSigner>) -> chain::ChannelMonitorUpdateStatus {
17                 self.update_ret.lock().unwrap().clone()
18         }
19
20         fn archive_persisted_channel(&self, _: OutPoint) {
21         }
22 }