X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchanmon_update_fail_tests.rs;h=e59cf47f17600963c9852389fc5723d8189816ef;hb=6aca7e1c4db17f43b79504fd44b942b4bc08db9d;hp=d495910eed10242917f0c7ad713896fe7a5eaa02;hpb=40626958e451a3d63edbbcf0bc4a5be3f32ff629;p=rust-lightning diff --git a/lightning/src/ln/chanmon_update_fail_tests.rs b/lightning/src/ln/chanmon_update_fail_tests.rs index d495910e..e59cf47f 100644 --- a/lightning/src/ln/chanmon_update_fail_tests.rs +++ b/lightning/src/ln/chanmon_update_fail_tests.rs @@ -12,7 +12,6 @@ //! There are a bunch of these as their handling is relatively error-prone so they are split out //! here. See also the chanmon_fail_consistency fuzz test. -use bitcoin::blockdata::block::{Block, BlockHeader}; use bitcoin::blockdata::constants::genesis_block; use bitcoin::hash_types::BlockHash; use bitcoin::network::constants::Network; @@ -35,7 +34,6 @@ use crate::util::test_utils; use crate::io; use bitcoin::hashes::Hash; -use bitcoin::TxMerkleNode; use crate::prelude::*; use crate::sync::{Arc, Mutex}; @@ -121,15 +119,7 @@ fn test_monitor_and_persister_update_fail() { assert_eq!(chain_mon.watch_channel(outpoint, new_monitor), ChannelMonitorUpdateStatus::Completed); chain_mon }; - let header = BlockHeader { - version: 0x20000000, - prev_blockhash: BlockHash::all_zeros(), - merkle_root: TxMerkleNode::all_zeros(), - time: 42, - bits: 42, - nonce: 42 - }; - chain_mon.chain_monitor.block_connected(&Block { header, txdata: vec![] }, 200); + chain_mon.chain_monitor.block_connected(&create_dummy_block(BlockHash::all_zeros(), 42, Vec::new()), 200); // Set the persister's return value to be a InProgress. persister.set_update_ret(ChannelMonitorUpdateStatus::InProgress);