Skip to content

Commit dedc66c

Browse files
committed
rustfmt: Run on lightning-block-sync/src/test_utils.rs
1 parent e8a1066 commit dedc66c

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

lightning-block-sync/src/test_utils.rs

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
use crate::{AsyncBlockSourceResult, BlockData, BlockHeaderData, BlockSource, BlockSourceError, UnboundedCache};
21
use crate::poll::{Validate, ValidatedBlockHeader};
2+
use crate::{
3+
AsyncBlockSourceResult, BlockData, BlockHeaderData, BlockSource, BlockSourceError,
4+
UnboundedCache,
5+
};
36

47
use bitcoin::blockdata::block::{Block, Header, Version};
58
use bitcoin::blockdata::constants::genesis_block;
69
use bitcoin::blockdata::locktime::absolute::LockTime;
710
use bitcoin::hash_types::{BlockHash, TxMerkleNode};
811
use bitcoin::network::Network;
9-
use bitcoin::Transaction;
1012
use bitcoin::transaction;
13+
use bitcoin::Transaction;
1114

1215
use lightning::chain;
1316

@@ -48,7 +51,7 @@ impl Blockchain {
4851
version: transaction::Version(0),
4952
lock_time: LockTime::ZERO,
5053
input: vec![],
51-
output: vec![]
54+
output: vec![],
5255
};
5356
let merkle_root = TxMerkleNode::from_raw_hash(coinbase.txid().to_raw_hash());
5457
self.blocks.push(Block {
@@ -135,7 +138,9 @@ impl Blockchain {
135138
}
136139

137140
impl BlockSource for Blockchain {
138-
fn get_header<'a>(&'a self, header_hash: &'a BlockHash, _height_hint: Option<u32>) -> AsyncBlockSourceResult<'a, BlockHeaderData> {
141+
fn get_header<'a>(
142+
&'a self, header_hash: &'a BlockHash, _height_hint: Option<u32>,
143+
) -> AsyncBlockSourceResult<'a, BlockHeaderData> {
139144
Box::pin(async move {
140145
if self.without_headers {
141146
return Err(BlockSourceError::persistent("header not found"));
@@ -155,7 +160,9 @@ impl BlockSource for Blockchain {
155160
})
156161
}
157162

158-
fn get_block<'a>(&'a self, header_hash: &'a BlockHash) -> AsyncBlockSourceResult<'a, BlockData> {
163+
fn get_block<'a>(
164+
&'a self, header_hash: &'a BlockHash,
165+
) -> AsyncBlockSourceResult<'a, BlockData> {
159166
Box::pin(async move {
160167
for (height, block) in self.blocks.iter().enumerate() {
161168
if block.header.block_hash() == *header_hash {
@@ -192,7 +199,10 @@ impl BlockSource for Blockchain {
192199
pub struct NullChainListener;
193200

194201
impl chain::Listen for NullChainListener {
195-
fn filtered_block_connected(&self, _header: &Header, _txdata: &chain::transaction::TransactionData, _height: u32) {}
202+
fn filtered_block_connected(
203+
&self, _header: &Header, _txdata: &chain::transaction::TransactionData, _height: u32,
204+
) {
205+
}
196206
fn block_disconnected(&self, _header: &Header, _height: u32) {}
197207
}
198208

@@ -240,7 +250,9 @@ impl chain::Listen for MockChainListener {
240250
}
241251
}
242252

243-
fn filtered_block_connected(&self, header: &Header, _txdata: &chain::transaction::TransactionData, height: u32) {
253+
fn filtered_block_connected(
254+
&self, header: &Header, _txdata: &chain::transaction::TransactionData, height: u32,
255+
) {
244256
match self.expected_filtered_blocks_connected.borrow_mut().pop_front() {
245257
None => {
246258
panic!("Unexpected filtered block connected: {:?}", header.block_hash());

rustfmt_excluded_files

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
./lightning-background-processor/src/lib.rs
22
./lightning-block-sync/src/lib.rs
3-
./lightning-block-sync/src/test_utils.rs
43
./lightning-block-sync/src/utils.rs
54
./lightning-custom-message/src/lib.rs
65
./lightning-invoice/fuzz/fuzz_targets/serde_data_part.rs

0 commit comments

Comments
 (0)