X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=fuzz%2Fsrc%2Fchanmon_deser.rs;fp=fuzz%2Fsrc%2Fchanmon_deser.rs;h=933930cf6d163148cb28832fde7cbcf47133b90b;hb=b5d88a5422913a0a8950455c5f86764a042429d7;hp=e7dbf3ed8d6a588aef5e7529d7295999018d01ca;hpb=1a8b9be5e432fe43b778292f530a8a09062999c8;p=rust-lightning diff --git a/fuzz/src/chanmon_deser.rs b/fuzz/src/chanmon_deser.rs index e7dbf3ed..933930cf 100644 --- a/fuzz/src/chanmon_deser.rs +++ b/fuzz/src/chanmon_deser.rs @@ -25,13 +25,11 @@ impl Writer for VecWriter { #[inline] pub fn do_test(data: &[u8], _out: Out) { - if let Ok((Some(latest_block_hash), monitor)) = <(Option, channelmonitor::ChannelMonitor)>::read(&mut Cursor::new(data), &OnlyReadsKeysInterface {}) { + if let Ok((latest_block_hash, monitor)) = <(BlockHash, channelmonitor::ChannelMonitor)>::read(&mut Cursor::new(data), &OnlyReadsKeysInterface {}) { let mut w = VecWriter(Vec::new()); monitor.write(&mut w).unwrap(); - let deserialized_copy = <(Option, channelmonitor::ChannelMonitor)>::read(&mut Cursor::new(&w.0), &OnlyReadsKeysInterface {}).unwrap(); - if let Some(deserialized) = deserialized_copy.0 { - assert!(latest_block_hash == deserialized); - } + 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); } }