mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-05-31 00:01:56 +08:00
Cargo Format
This commit is contained in:
@@ -360,9 +360,9 @@ fn test_process_block_ops() {
|
||||
miner_pk_hash: None,
|
||||
};
|
||||
|
||||
let block_ops_123 = vec![
|
||||
BlockstackOperationType::LeaderKeyRegister(leader_key_1.clone()),
|
||||
];
|
||||
let block_ops_123 = vec![BlockstackOperationType::LeaderKeyRegister(
|
||||
leader_key_1.clone(),
|
||||
)];
|
||||
let block_opshash_123 = OpsHash::from_txids(&vec![
|
||||
// notably, the user burns here _wont_ be included in the consensus hash
|
||||
leader_key_1.txid.clone(),
|
||||
|
||||
@@ -902,14 +902,13 @@ fn mine_10_stacks_blocks_1_fork() {
|
||||
next_block_hashes.push(hash);
|
||||
}
|
||||
|
||||
let (next_snapshot, mut next_prev_keys, next_block_commits) =
|
||||
process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork,
|
||||
&mut miners,
|
||||
&prev_keys,
|
||||
&next_block_hashes,
|
||||
);
|
||||
let (next_snapshot, mut next_prev_keys, next_block_commits) = process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork,
|
||||
&mut miners,
|
||||
&prev_keys,
|
||||
&next_block_hashes,
|
||||
);
|
||||
|
||||
verify_keys_accepted(&mut node, &prev_keys);
|
||||
verify_commits_accepted(&mut node, &next_block_commits);
|
||||
@@ -951,14 +950,13 @@ fn mine_10_stacks_blocks_2_forks_disjoint() {
|
||||
next_block_hashes.push(hash);
|
||||
}
|
||||
|
||||
let (next_snapshot, mut next_prev_keys, next_block_commits) =
|
||||
process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork_1,
|
||||
&mut miners,
|
||||
&prev_keys_1,
|
||||
&next_block_hashes,
|
||||
);
|
||||
let (next_snapshot, mut next_prev_keys, next_block_commits) = process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork_1,
|
||||
&mut miners,
|
||||
&prev_keys_1,
|
||||
&next_block_hashes,
|
||||
);
|
||||
|
||||
verify_keys_accepted(&mut node, &prev_keys_1);
|
||||
verify_commits_accepted(&mut node, &next_block_commits);
|
||||
@@ -1004,22 +1002,20 @@ fn mine_10_stacks_blocks_2_forks_disjoint() {
|
||||
next_block_hashes_2.push(hash);
|
||||
}
|
||||
|
||||
let (next_snapshot_1, mut next_prev_keys_1, next_block_commits_1) =
|
||||
process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork_1,
|
||||
&mut miners_1,
|
||||
&prev_keys_1,
|
||||
&next_block_hashes_1,
|
||||
);
|
||||
let (next_snapshot_2, mut next_prev_keys_2, next_block_commits_2) =
|
||||
process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork_2,
|
||||
&mut miners_2,
|
||||
&prev_keys_2,
|
||||
&next_block_hashes_2,
|
||||
);
|
||||
let (next_snapshot_1, mut next_prev_keys_1, next_block_commits_1) = process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork_1,
|
||||
&mut miners_1,
|
||||
&prev_keys_1,
|
||||
&next_block_hashes_1,
|
||||
);
|
||||
let (next_snapshot_2, mut next_prev_keys_2, next_block_commits_2) = process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork_2,
|
||||
&mut miners_2,
|
||||
&prev_keys_2,
|
||||
&next_block_hashes_2,
|
||||
);
|
||||
|
||||
assert!(next_snapshot_1.burn_header_hash != next_snapshot_2.burn_header_hash);
|
||||
|
||||
@@ -1069,14 +1065,13 @@ fn mine_10_stacks_blocks_2_forks_disjoint_same_blocks() {
|
||||
next_block_hashes.push(hash);
|
||||
}
|
||||
|
||||
let (snapshot, mut next_prev_keys, next_block_commits) =
|
||||
process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork_1,
|
||||
&mut miners,
|
||||
&prev_keys_1,
|
||||
&next_block_hashes,
|
||||
);
|
||||
let (snapshot, mut next_prev_keys, next_block_commits) = process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork_1,
|
||||
&mut miners,
|
||||
&prev_keys_1,
|
||||
&next_block_hashes,
|
||||
);
|
||||
|
||||
verify_keys_accepted(&mut node, &prev_keys_1);
|
||||
verify_commits_accepted(&mut node, &next_block_commits);
|
||||
@@ -1124,22 +1119,20 @@ fn mine_10_stacks_blocks_2_forks_disjoint_same_blocks() {
|
||||
next_block_hashes_2.push(hash);
|
||||
}
|
||||
|
||||
let (snapshot_1, mut next_prev_keys_1, next_block_commits_1) =
|
||||
process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork_1,
|
||||
&mut miners_1,
|
||||
&prev_keys_1,
|
||||
&next_block_hashes_1,
|
||||
);
|
||||
let (snapshot_2, mut next_prev_keys_2, next_block_commits_2) =
|
||||
process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork_2,
|
||||
&mut miners_2,
|
||||
&prev_keys_2,
|
||||
&next_block_hashes_2,
|
||||
);
|
||||
let (snapshot_1, mut next_prev_keys_1, next_block_commits_1) = process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork_1,
|
||||
&mut miners_1,
|
||||
&prev_keys_1,
|
||||
&next_block_hashes_1,
|
||||
);
|
||||
let (snapshot_2, mut next_prev_keys_2, next_block_commits_2) = process_next_sortition(
|
||||
&mut node,
|
||||
&mut fork_2,
|
||||
&mut miners_2,
|
||||
&prev_keys_2,
|
||||
&next_block_hashes_2,
|
||||
);
|
||||
|
||||
assert!(snapshot_1.burn_header_hash != snapshot_2.burn_header_hash);
|
||||
assert!(snapshot_1.consensus_hash != snapshot_2.consensus_hash);
|
||||
|
||||
@@ -7197,9 +7197,9 @@ pub mod tests {
|
||||
let commit_snapshot = test_append_snapshot(
|
||||
&mut db,
|
||||
BurnchainHeaderHash([0x03; 32]),
|
||||
&vec![
|
||||
BlockstackOperationType::LeaderBlockCommit(block_commit.clone()),
|
||||
],
|
||||
&vec![BlockstackOperationType::LeaderBlockCommit(
|
||||
block_commit.clone(),
|
||||
)],
|
||||
);
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user