X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=fuzz%2Fsrc%2Fchanmon_deser.rs;h=b9c0121377245cb73b62a23ca24cea4f97c729d8;hb=39cc28bfaa26a4fe4694cc92dba4f537a96739e7;hp=c31930342f43101e2b4e4bbac717939e3047a677;hpb=730d5639a4d75b7732e9ed0c65291dcbfc2ec134;p=rust-lightning diff --git a/fuzz/src/chanmon_deser.rs b/fuzz/src/chanmon_deser.rs index c3193034..b9c01213 100644 --- a/fuzz/src/chanmon_deser.rs +++ b/fuzz/src/chanmon_deser.rs @@ -4,11 +4,11 @@ use bitcoin::hash_types::BlockHash; use lightning::chain::channelmonitor; -use lightning::util::enforcing_trait_impls::EnforcingSigner; -use lightning::util::ser::{ReadableArgs, Writer, Writeable}; +use lightning::util::ser::{ReadableArgs, Writeable, Writer}; +use lightning::util::test_channel_signer::TestChannelSigner; use lightning::util::test_utils::OnlyReadsKeysInterface; -use utils::test_logger; +use crate::utils::test_logger; use std::io::Cursor; @@ -22,10 +22,19 @@ impl Writer for VecWriter { #[inline] pub fn do_test(data: &[u8], _out: Out) { - if let Ok((latest_block_hash, monitor)) = <(BlockHash, channelmonitor::ChannelMonitor)>::read(&mut Cursor::new(data), &OnlyReadsKeysInterface {}) { + if let Ok((latest_block_hash, monitor)) = + <(BlockHash, channelmonitor::ChannelMonitor)>::read( + &mut Cursor::new(data), + (&OnlyReadsKeysInterface {}, &OnlyReadsKeysInterface {}), + ) { let mut w = VecWriter(Vec::new()); monitor.write(&mut w).unwrap(); - let deserialized_copy = <(BlockHash, channelmonitor::ChannelMonitor)>::read(&mut Cursor::new(&w.0), &OnlyReadsKeysInterface {}).unwrap(); + let deserialized_copy = + <(BlockHash, channelmonitor::ChannelMonitor)>::read( + &mut Cursor::new(&w.0), + (&OnlyReadsKeysInterface {}, &OnlyReadsKeysInterface {}), + ) + .unwrap(); assert!(latest_block_hash == deserialized_copy.0); assert!(monitor == deserialized_copy.1); } @@ -37,5 +46,5 @@ pub fn chanmon_deser_test(data: &[u8], out: Out) { #[no_mangle] pub extern "C" fn chanmon_deser_run(data: *const u8, datalen: usize) { - do_test(unsafe { std::slice::from_raw_parts(data, datalen) }, test_logger::DevNull{}); + do_test(unsafe { std::slice::from_raw_parts(data, datalen) }, test_logger::DevNull {}); }