]> git.bitcoin.ninja Git - rust-lightning/commitdiff
`rustfmt`: Run on `lightning-block-sync/src/test_utils.rs`
authorElias Rohrer <dev@tnull.de>
Thu, 20 Jun 2024 09:09:15 +0000 (11:09 +0200)
committerElias Rohrer <dev@tnull.de>
Mon, 15 Jul 2024 11:55:39 +0000 (13:55 +0200)
lightning-block-sync/src/test_utils.rs
rustfmt_excluded_files

index 84c65f244f00e2c2d3fb81ebf976e535c06f8ac7..506c2183e6b341812f4191a7a054edf5ee5e0c88 100644 (file)
@@ -1,13 +1,16 @@
-use crate::{AsyncBlockSourceResult, BlockData, BlockHeaderData, BlockSource, BlockSourceError, UnboundedCache};
 use crate::poll::{Validate, ValidatedBlockHeader};
+use crate::{
+       AsyncBlockSourceResult, BlockData, BlockHeaderData, BlockSource, BlockSourceError,
+       UnboundedCache,
+};
 
 use bitcoin::blockdata::block::{Block, Header, Version};
 use bitcoin::blockdata::constants::genesis_block;
 use bitcoin::blockdata::locktime::absolute::LockTime;
 use bitcoin::hash_types::{BlockHash, TxMerkleNode};
 use bitcoin::network::Network;
-use bitcoin::Transaction;
 use bitcoin::transaction;
+use bitcoin::Transaction;
 
 use lightning::chain;
 
@@ -48,7 +51,7 @@ impl Blockchain {
                                version: transaction::Version(0),
                                lock_time: LockTime::ZERO,
                                input: vec![],
-                               output: vec![]
+                               output: vec![],
                        };
                        let merkle_root = TxMerkleNode::from_raw_hash(coinbase.txid().to_raw_hash());
                        self.blocks.push(Block {
@@ -135,7 +138,9 @@ impl Blockchain {
 }
 
 impl BlockSource for Blockchain {
-       fn get_header<'a>(&'a self, header_hash: &'a BlockHash, _height_hint: Option<u32>) -> AsyncBlockSourceResult<'a, BlockHeaderData> {
+       fn get_header<'a>(
+               &'a self, header_hash: &'a BlockHash, _height_hint: Option<u32>,
+       ) -> AsyncBlockSourceResult<'a, BlockHeaderData> {
                Box::pin(async move {
                        if self.without_headers {
                                return Err(BlockSourceError::persistent("header not found"));
@@ -155,7 +160,9 @@ impl BlockSource for Blockchain {
                })
        }
 
-       fn get_block<'a>(&'a self, header_hash: &'a BlockHash) -> AsyncBlockSourceResult<'a, BlockData> {
+       fn get_block<'a>(
+               &'a self, header_hash: &'a BlockHash,
+       ) -> AsyncBlockSourceResult<'a, BlockData> {
                Box::pin(async move {
                        for (height, block) in self.blocks.iter().enumerate() {
                                if block.header.block_hash() == *header_hash {
@@ -192,7 +199,10 @@ impl BlockSource for Blockchain {
 pub struct NullChainListener;
 
 impl chain::Listen for NullChainListener {
-       fn filtered_block_connected(&self, _header: &Header, _txdata: &chain::transaction::TransactionData, _height: u32) {}
+       fn filtered_block_connected(
+               &self, _header: &Header, _txdata: &chain::transaction::TransactionData, _height: u32,
+       ) {
+       }
        fn block_disconnected(&self, _header: &Header, _height: u32) {}
 }
 
@@ -240,7 +250,9 @@ impl chain::Listen for MockChainListener {
                }
        }
 
-       fn filtered_block_connected(&self, header: &Header, _txdata: &chain::transaction::TransactionData, height: u32) {
+       fn filtered_block_connected(
+               &self, header: &Header, _txdata: &chain::transaction::TransactionData, height: u32,
+       ) {
                match self.expected_filtered_blocks_connected.borrow_mut().pop_front() {
                        None => {
                                panic!("Unexpected filtered block connected: {:?}", header.block_hash());
index 98f412a827ebc2c91dbd48a17497f83bb99dd4d1..7b942c5f68682237b2a3ecb4fc3fddb669bf5d55 100644 (file)
@@ -1,6 +1,5 @@
 ./lightning-background-processor/src/lib.rs
 ./lightning-block-sync/src/lib.rs
-./lightning-block-sync/src/test_utils.rs
 ./lightning-block-sync/src/utils.rs
 ./lightning-custom-message/src/lib.rs
 ./lightning-invoice/fuzz/fuzz_targets/serde_data_part.rs