Skip to content

Commit 7ab74a7

Browse files
author
Aaron Blankstein
committed
cargo fmt
1 parent 39f325d commit 7ab74a7

File tree

4 files changed

+24
-28
lines changed

4 files changed

+24
-28
lines changed

src/chainstate/coordinator/mod.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::time::Duration;
2020

2121
use burnchains::{
2222
db::{BurnchainBlockData, BurnchainDB},
23-
Txid, Burnchain, BurnchainBlockHeader, BurnchainHeaderHash, Error as BurnchainError,
23+
Burnchain, BurnchainBlockHeader, BurnchainHeaderHash, Error as BurnchainError, Txid,
2424
};
2525
use chainstate::burn::{
2626
db::sortdb::{PoxId, SortitionDB, SortitionId},
@@ -107,7 +107,7 @@ pub trait BlockEventDispatcher {
107107
metadata: StacksHeaderInfo,
108108
receipts: Vec<StacksTransactionReceipt>,
109109
parent: &StacksBlockId,
110-
winner_txid: Txid
110+
winner_txid: Txid,
111111
);
112112

113113
fn dispatch_boot_receipts(&mut self, receipts: Vec<StacksTransactionReceipt>);
@@ -581,21 +581,24 @@ impl<'a, T: BlockEventDispatcher, N: CoordinatorNotices, U: RewardSetProvider>
581581
"FAIL: could not find data for the canonical sortition {}",
582582
canonical_sortition_tip
583583
));
584-
let new_canonical_stacks_block = new_canonical_block_snapshot
585-
.get_canonical_stacks_block_id();
584+
let new_canonical_stacks_block =
585+
new_canonical_block_snapshot.get_canonical_stacks_block_id();
586586
self.canonical_chain_tip = Some(new_canonical_stacks_block);
587587
debug!("Bump blocks processed");
588588
self.notifier.notify_stacks_block_processed();
589589
increment_stx_blocks_processed_counter();
590590
let block_hash = block_receipt.header.anchored_header.block_hash();
591591

592592
if let Some(dispatcher) = self.dispatcher {
593-
let metadata = &block_receipt.header;
593+
let metadata = &block_receipt.header;
594594
let winner_txid = SortitionDB::get_block_snapshot_for_winning_stacks_block(
595-
&self.sortition_db.index_conn(), canonical_sortition_tip, &block_hash)
596-
.expect("FAIL: could not find block snapshot for winning block hash")
597-
.expect("FAIL: could not find block snapshot for winning block hash")
598-
.winning_block_txid;
595+
&self.sortition_db.index_conn(),
596+
canonical_sortition_tip,
597+
&block_hash,
598+
)
599+
.expect("FAIL: could not find block snapshot for winning block hash")
600+
.expect("FAIL: could not find block snapshot for winning block hash")
601+
.winning_block_txid;
599602

600603
let block: StacksBlock = {
601604
let block_path = StacksChainState::get_block_path(
@@ -617,7 +620,7 @@ impl<'a, T: BlockEventDispatcher, N: CoordinatorNotices, U: RewardSetProvider>
617620
block_receipt.header,
618621
block_receipt.tx_receipts,
619622
&parent,
620-
winner_txid
623+
winner_txid,
621624
);
622625
}
623626

src/chainstate/coordinator/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl BlockEventDispatcher for NullEventDispatcher {
228228
_metadata: StacksHeaderInfo,
229229
_receipts: Vec<StacksTransactionReceipt>,
230230
_parent: &StacksBlockId,
231-
_winner_txid: Txid
231+
_winner_txid: Txid,
232232
) {
233233
assert!(
234234
false,

testnet/stacks-node/src/event_dispatcher.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,12 @@ impl EventDispatcher {
265265
}
266266
}
267267

268-
pub fn process_chain_tip(&self, chain_tip: &ChainTip, parent_index_hash: &StacksBlockId, winner_txid: Txid) {
268+
pub fn process_chain_tip(
269+
&self,
270+
chain_tip: &ChainTip,
271+
parent_index_hash: &StacksBlockId,
272+
winner_txid: Txid,
273+
) {
269274
let mut dispatch_matrix: Vec<HashSet<usize>> = self
270275
.registered_observers
271276
.iter()
@@ -351,7 +356,7 @@ impl EventDispatcher {
351356
chain_tip,
352357
parent_index_hash,
353358
boot_receipts,
354-
&winner_txid
359+
&winner_txid,
355360
);
356361
}
357362
}

testnet/stacks-node/src/tests/neon_integrations.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -495,23 +495,11 @@ fn microblock_integration_test() {
495495

496496
eprintln!("{}", block);
497497

498-
let _burn_block_hash = block
499-
.get("burn_block_hash")
500-
.unwrap()
501-
.as_str()
502-
.unwrap();
498+
let _burn_block_hash = block.get("burn_block_hash").unwrap().as_str().unwrap();
503499

504-
let _burn_block_height = block
505-
.get("burn_block_height")
506-
.unwrap()
507-
.as_u64()
508-
.unwrap();
500+
let _burn_block_height = block.get("burn_block_height").unwrap().as_u64().unwrap();
509501

510-
let _miner_txid = block
511-
.get("miner_txid")
512-
.unwrap()
513-
.as_str()
514-
.unwrap();
502+
let _miner_txid = block.get("miner_txid").unwrap().as_str().unwrap();
515503

516504
prior = Some(my_index_hash);
517505
}

0 commit comments

Comments
 (0)