X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=fuzz%2Fsrc%2Fchanmon_deser.rs;h=933930cf6d163148cb28832fde7cbcf47133b90b;hb=refs%2Fheads%2F2021-07-forward-event;hp=52caf36e1b96c092cd8f029e37b86816a46a8679;hpb=ea4ccf63c7b8a8af5107c536bb6ab01ee04cbdc4;p=rust-lightning diff --git a/fuzz/src/chanmon_deser.rs b/fuzz/src/chanmon_deser.rs index 52caf36e..933930cf 100644 --- a/fuzz/src/chanmon_deser.rs +++ b/fuzz/src/chanmon_deser.rs @@ -3,14 +3,14 @@ use bitcoin::hash_types::BlockHash; -use lightning::util::enforcing_trait_impls::EnforcingChannelKeys; -use lightning::ln::channelmonitor; -use lightning::util::ser::{ReadableArgs, Writer}; +use lightning::chain::channelmonitor; +use lightning::util::enforcing_trait_impls::EnforcingSigner; +use lightning::util::ser::{ReadableArgs, Writer, Writeable}; +use lightning::util::test_utils::OnlyReadsKeysInterface; use utils::test_logger; use std::io::Cursor; -use std::sync::Arc; struct VecWriter(Vec); impl Writer for VecWriter { @@ -24,12 +24,11 @@ impl Writer for VecWriter { } #[inline] -pub fn do_test(data: &[u8], out: Out) { - let logger = Arc::new(test_logger::TestLogger::new("".to_owned(), out)); - if let Ok((latest_block_hash, monitor)) = <(BlockHash, channelmonitor::ChannelMonitor)>::read(&mut Cursor::new(data), logger.clone()) { +pub fn do_test(data: &[u8], _out: Out) { + if let Ok((latest_block_hash, monitor)) = <(BlockHash, channelmonitor::ChannelMonitor)>::read(&mut Cursor::new(data), &OnlyReadsKeysInterface {}) { let mut w = VecWriter(Vec::new()); - monitor.write_for_disk(&mut w).unwrap(); - let deserialized_copy = <(BlockHash, channelmonitor::ChannelMonitor)>::read(&mut Cursor::new(&w.0), logger.clone()).unwrap(); + monitor.write(&mut w).unwrap(); + let deserialized_copy = <(BlockHash, channelmonitor::ChannelMonitor)>::read(&mut Cursor::new(&w.0), &OnlyReadsKeysInterface {}).unwrap(); assert!(latest_block_hash == deserialized_copy.0); assert!(monitor == deserialized_copy.1); }