Use Writeable for ChannelMonitor instead of a specific function.
[rust-lightning] / fuzz / src / chanmon_consistency.rs
index 377ac8d7b5702c439e84dcc7b1db898645483428..732f0f5b1832028608ecab5b022ea22d446bc07c 100644 (file)
@@ -112,7 +112,7 @@ impl chain::Watch for TestChainMonitor {
 
        fn watch_channel(&self, funding_txo: OutPoint, monitor: channelmonitor::ChannelMonitor<EnforcingChannelKeys>) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
                let mut ser = VecWriter(Vec::new());
-               monitor.serialize_for_disk(&mut ser).unwrap();
+               monitor.write(&mut ser).unwrap();
                if let Some(_) = self.latest_monitors.lock().unwrap().insert(funding_txo, (monitor.get_latest_update_id(), ser.0)) {
                        panic!("Already had monitor pre-watch_channel");
                }
@@ -131,7 +131,7 @@ impl chain::Watch for TestChainMonitor {
                        read(&mut Cursor::new(&map_entry.get().1)).unwrap().1;
                deserialized_monitor.update_monitor(&update, &&TestBroadcaster{}, &&FuzzEstimator{}, &self.logger).unwrap();
                let mut ser = VecWriter(Vec::new());
-               deserialized_monitor.serialize_for_disk(&mut ser).unwrap();
+               deserialized_monitor.write(&mut ser).unwrap();
                map_entry.insert((update.update_id, ser.0));
                self.should_update_manager.store(true, atomic::Ordering::Relaxed);
                self.update_ret.lock().unwrap().clone()