Adopting new bitcoin hash types and crate version
[rust-lightning] / fuzz / src / chanmon_deser.rs
index 45da43c0bee63b4fd64baa87b54a3d07bed00d18..52caf36e1b96c092cd8f029e37b86816a46a8679 100644 (file)
@@ -1,7 +1,7 @@
 // This file is auto-generated by gen_target.sh based on msg_target_template.txt
 // To modify it, modify msg_target_template.txt and run gen_target.sh instead.
 
-use bitcoin::hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hash_types::BlockHash;
 
 use lightning::util::enforcing_trait_impls::EnforcingChannelKeys;
 use lightning::ln::channelmonitor;
@@ -26,10 +26,10 @@ impl Writer for VecWriter {
 #[inline]
 pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
        let logger = Arc::new(test_logger::TestLogger::new("".to_owned(), out));
-       if let Ok((latest_block_hash, monitor)) = <(Sha256dHash, channelmonitor::ChannelMonitor<EnforcingChannelKeys>)>::read(&mut Cursor::new(data), logger.clone()) {
+       if let Ok((latest_block_hash, monitor)) = <(BlockHash, channelmonitor::ChannelMonitor<EnforcingChannelKeys>)>::read(&mut Cursor::new(data), logger.clone()) {
                let mut w = VecWriter(Vec::new());
                monitor.write_for_disk(&mut w).unwrap();
-               let deserialized_copy = <(Sha256dHash, channelmonitor::ChannelMonitor<EnforcingChannelKeys>)>::read(&mut Cursor::new(&w.0), logger.clone()).unwrap();
+               let deserialized_copy = <(BlockHash, channelmonitor::ChannelMonitor<EnforcingChannelKeys>)>::read(&mut Cursor::new(&w.0), logger.clone()).unwrap();
                assert!(latest_block_hash == deserialized_copy.0);
                assert!(monitor == deserialized_copy.1);
        }