X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=fuzz%2Fsrc%2Fchanmon_deser.rs;h=933930cf6d163148cb28832fde7cbcf47133b90b;hb=9fba7c92ad42c847923ddefc7c3f852b2eb17496;hp=0f8fc9f6074e0ffefca9390e56f248fb1deec91b;hpb=51a5a1a50f59ecdddece6e0baeb0ac0ec48d168a;p=rust-lightning diff --git a/fuzz/src/chanmon_deser.rs b/fuzz/src/chanmon_deser.rs index 0f8fc9f6..933930cf 100644 --- a/fuzz/src/chanmon_deser.rs +++ b/fuzz/src/chanmon_deser.rs @@ -3,9 +3,10 @@ use bitcoin::hash_types::BlockHash; -use lightning::chain::chainmonitor; -use lightning::util::enforcing_trait_impls::EnforcingChannelKeys; -use lightning::util::ser::{Readable, 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; @@ -24,10 +25,10 @@ impl Writer for VecWriter { #[inline] pub fn do_test(data: &[u8], _out: Out) { - if let Ok((latest_block_hash, monitor)) = <(BlockHash, chainmonitor::ChannelMonitor)>::read(&mut Cursor::new(data)) { + 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, chainmonitor::ChannelMonitor)>::read(&mut Cursor::new(&w.0)).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); }