You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`rust-bitcoin v0.30.0` introduces concrete variants for data members of
block `Header`s. To avoid having to update these across every use, we
introduce new helpers to create dummy blocks and headers, such that the
update process is a bit more straight-forward.
let header = BlockHeader{version:0x20000000,prev_blockhash:self.header_hashes[self.height].0,merkle_root:TxMerkleNode::all_zeros(),time:self.blocks_connected,bits:42,nonce:42};
230
+
let header = create_dummy_header(self.header_hashes[self.height].0,self.blocks_connected);
Copy file name to clipboardExpand all lines: lightning-persister/src/lib.rs
+2-5Lines changed: 2 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -136,9 +136,8 @@ mod tests {
136
136
externcrate lightning;
137
137
externcrate bitcoin;
138
138
usecrate::FilesystemPersister;
139
-
use bitcoin::blockdata::block::{Block,BlockHeader};
140
139
use bitcoin::hashes::hex::FromHex;
141
-
use bitcoin::{Txid,TxMerkleNode};
140
+
use bitcoin::Txid;
142
141
use lightning::chain::ChannelMonitorUpdateStatus;
143
142
use lightning::chain::chainmonitor::Persist;
144
143
use lightning::chain::channelmonitor::CLOSED_CHANNEL_UPDATE_ID;
@@ -148,7 +147,6 @@ mod tests {
148
147
use lightning::ln::functional_test_utils::*;
149
148
use lightning::util::test_utils;
150
149
use std::fs;
151
-
use bitcoin::hashes::Hash;
152
150
#[cfg(target_os = "windows")]
153
151
use{
154
152
lightning::get_event_msg,
@@ -247,8 +245,7 @@ mod tests {
247
245
let node_txn = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap();
248
246
assert_eq!(node_txn.len(),1);
249
247
250
-
let header = BlockHeader{version:0x20000000,prev_blockhash: nodes[0].best_block_hash(),merkle_root:TxMerkleNode::all_zeros(),time:42,bits:42,nonce:42};
0 commit comments