Skip to content

Commit f8d7404

Browse files
committed
Standardize command naming pattern to not include "Command"
1 parent 6eb7cf0 commit f8d7404

File tree

8 files changed

+56
-56
lines changed

8 files changed

+56
-56
lines changed

testnet/stacks-node/src/tests/signer/commands/block_commit.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ use madhouse::{Command, CommandWrapper};
44
use proptest::prelude::{Just, Strategy};
55
use std::sync::{Arc, Mutex};
66

7-
pub struct SubmitBlockCommitSecondaryMinerCommand {
7+
pub struct SubmitBlockCommitSecondaryMiner {
88
miners: Arc<Mutex<MultipleMinerTest>>,
99
}
1010

11-
impl SubmitBlockCommitSecondaryMinerCommand {
11+
impl SubmitBlockCommitSecondaryMiner {
1212
pub fn new(miners: Arc<Mutex<MultipleMinerTest>>) -> Self {
1313
Self { miners }
1414
}
1515
}
1616

17-
impl Command<SignerTestState, SignerTestContext> for SubmitBlockCommitSecondaryMinerCommand {
17+
impl Command<SignerTestState, SignerTestContext> for SubmitBlockCommitSecondaryMiner {
1818
fn check(&self, state: &SignerTestState) -> bool {
1919
info!(
2020
"Checking: Submitting block commit miner 2. Result: {:?}",
@@ -41,22 +41,22 @@ impl Command<SignerTestState, SignerTestContext> for SubmitBlockCommitSecondaryM
4141
ctx: Arc<SignerTestContext>,
4242
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
4343
Just(CommandWrapper::new(
44-
SubmitBlockCommitSecondaryMinerCommand::new(ctx.miners.clone()),
44+
SubmitBlockCommitSecondaryMiner::new(ctx.miners.clone()),
4545
))
4646
}
4747
}
4848

49-
pub struct SubmitBlockCommitPrimaryMinerCommand {
49+
pub struct SubmitBlockCommitPrimaryMiner {
5050
miners: Arc<Mutex<MultipleMinerTest>>,
5151
}
5252

53-
impl SubmitBlockCommitPrimaryMinerCommand {
53+
impl SubmitBlockCommitPrimaryMiner {
5454
pub fn new(miners: Arc<Mutex<MultipleMinerTest>>) -> Self {
5555
Self { miners }
5656
}
5757
}
5858

59-
impl Command<SignerTestState, SignerTestContext> for SubmitBlockCommitPrimaryMinerCommand {
59+
impl Command<SignerTestState, SignerTestContext> for SubmitBlockCommitPrimaryMiner {
6060
fn check(&self, state: &SignerTestState) -> bool {
6161
info!(
6262
"Checking: Submitting block commit miner 1. Result: {:?}",
@@ -83,7 +83,7 @@ impl Command<SignerTestState, SignerTestContext> for SubmitBlockCommitPrimaryMin
8383
ctx: Arc<SignerTestContext>,
8484
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
8585
Just(CommandWrapper::new(
86-
SubmitBlockCommitPrimaryMinerCommand::new(ctx.miners.clone()),
86+
SubmitBlockCommitPrimaryMiner::new(ctx.miners.clone()),
8787
))
8888
}
8989
}

testnet/stacks-node/src/tests/signer/commands/block_wait.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ use madhouse::{Command, CommandWrapper};
44
use proptest::prelude::{Just, Strategy};
55
use std::sync::{atomic::Ordering, Arc, Mutex};
66

7-
pub struct WaitForBlockFromMiner1Command {
7+
pub struct WaitForBlockFromMiner1 {
88
miners: Arc<Mutex<MultipleMinerTest>>,
99
}
1010

11-
impl WaitForBlockFromMiner1Command {
11+
impl WaitForBlockFromMiner1 {
1212
pub fn new(miners: Arc<Mutex<MultipleMinerTest>>) -> Self {
1313
Self { miners }
1414
}
1515
}
1616

17-
impl Command<SignerTestState, SignerTestContext> for WaitForBlockFromMiner1Command {
17+
impl Command<SignerTestState, SignerTestContext> for WaitForBlockFromMiner1 {
1818
fn check(&self, state: &SignerTestState) -> bool {
1919
info!(
2020
"Checking: Waiting for Nakamoto block from miner 1. Result: {:?}",
@@ -56,23 +56,23 @@ impl Command<SignerTestState, SignerTestContext> for WaitForBlockFromMiner1Comma
5656
fn build(
5757
ctx: Arc<SignerTestContext>,
5858
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
59-
Just(CommandWrapper::new(WaitForBlockFromMiner1Command::new(
59+
Just(CommandWrapper::new(WaitForBlockFromMiner1::new(
6060
ctx.miners.clone(),
6161
)))
6262
}
6363
}
6464

65-
pub struct WaitForBlockFromMiner2Command {
65+
pub struct WaitForBlockFromMiner2 {
6666
miners: Arc<Mutex<MultipleMinerTest>>,
6767
}
6868

69-
impl WaitForBlockFromMiner2Command {
69+
impl WaitForBlockFromMiner2 {
7070
pub fn new(miners: Arc<Mutex<MultipleMinerTest>>) -> Self {
7171
Self { miners }
7272
}
7373
}
7474

75-
impl Command<SignerTestState, SignerTestContext> for WaitForBlockFromMiner2Command {
75+
impl Command<SignerTestState, SignerTestContext> for WaitForBlockFromMiner2 {
7676
fn check(&self, state: &SignerTestState) -> bool {
7777
info!(
7878
"Checking: Waiting for Nakamoto block from miner 2. Result: {:?}",
@@ -115,7 +115,7 @@ impl Command<SignerTestState, SignerTestContext> for WaitForBlockFromMiner2Comma
115115
fn build(
116116
ctx: Arc<SignerTestContext>,
117117
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
118-
Just(CommandWrapper::new(WaitForBlockFromMiner2Command::new(
118+
Just(CommandWrapper::new(WaitForBlockFromMiner2::new(
119119
ctx.miners.clone(),
120120
)))
121121
}

testnet/stacks-node/src/tests/signer/commands/mining.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ use stacks::chainstate::stacks::TenureChangeCause;
88
use std::sync::{Arc, Mutex};
99
use tracing::info;
1010

11-
pub struct MineBitcoinBlockTenureChangePrimaryMinerCommand {
11+
pub struct MineBitcoinBlockTenureChangePrimaryMiner {
1212
miners: Arc<Mutex<MultipleMinerTest>>,
1313
}
1414

15-
impl MineBitcoinBlockTenureChangePrimaryMinerCommand {
15+
impl MineBitcoinBlockTenureChangePrimaryMiner {
1616
pub fn new(miners: Arc<Mutex<MultipleMinerTest>>) -> Self {
1717
Self { miners }
1818
}
1919
}
2020

2121
impl Command<SignerTestState, SignerTestContext>
22-
for MineBitcoinBlockTenureChangePrimaryMinerCommand
22+
for MineBitcoinBlockTenureChangePrimaryMiner
2323
{
2424
fn check(&self, state: &SignerTestState) -> bool {
2525
info!(
@@ -77,23 +77,23 @@ impl Command<SignerTestState, SignerTestContext>
7777
ctx: Arc<SignerTestContext>,
7878
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
7979
Just(CommandWrapper::new(
80-
MineBitcoinBlockTenureChangePrimaryMinerCommand::new(ctx.miners.clone()),
80+
MineBitcoinBlockTenureChangePrimaryMiner::new(ctx.miners.clone()),
8181
))
8282
}
8383
}
8484

85-
pub struct MineBitcoinBlockTenureChangeSecondaryMinerCommand {
85+
pub struct MineBitcoinBlockTenureChangeSecondaryMiner {
8686
miners: Arc<Mutex<MultipleMinerTest>>,
8787
}
8888

89-
impl MineBitcoinBlockTenureChangeSecondaryMinerCommand {
89+
impl MineBitcoinBlockTenureChangeSecondaryMiner {
9090
pub fn new(miners: Arc<Mutex<MultipleMinerTest>>) -> Self {
9191
Self { miners }
9292
}
9393
}
9494

9595
impl Command<SignerTestState, SignerTestContext>
96-
for MineBitcoinBlockTenureChangeSecondaryMinerCommand
96+
for MineBitcoinBlockTenureChangeSecondaryMiner
9797
{
9898
fn check(&self, state: &SignerTestState) -> bool {
9999
info!(
@@ -147,7 +147,7 @@ impl Command<SignerTestState, SignerTestContext>
147147
ctx: Arc<SignerTestContext>,
148148
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
149149
Just(CommandWrapper::new(
150-
MineBitcoinBlockTenureChangeSecondaryMinerCommand::new(ctx.miners.clone()),
150+
MineBitcoinBlockTenureChangeSecondaryMiner::new(ctx.miners.clone()),
151151
))
152152
}
153153
}

testnet/stacks-node/src/tests/signer/commands/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ mod transfer;
1313
pub use context::{SignerTestContext};
1414

1515
pub use block_commit::{
16-
SubmitBlockCommitPrimaryMinerCommand, SubmitBlockCommitSecondaryMinerCommand,
16+
SubmitBlockCommitPrimaryMiner, SubmitBlockCommitSecondaryMiner,
1717
};
18-
pub use block_wait::{WaitForBlockFromMiner1Command, WaitForBlockFromMiner2Command};
18+
pub use block_wait::{WaitForBlockFromMiner1, WaitForBlockFromMiner2};
1919
pub use boot::BootToEpoch3;
2020
pub use commit_ops::{SkipCommitOpPrimaryMiner, SkipCommitOpSecondaryMiner};
21-
pub use mining::MineBitcoinBlockTenureChangePrimaryMinerCommand;
22-
pub use shutdown::ShutdownMinersCommand;
23-
pub use stalling::{RecoverFromStallCommand, StallMiningCommand};
21+
pub use mining::MineBitcoinBlockTenureChangePrimaryMiner;
22+
pub use shutdown::ShutdownMiners;
23+
pub use stalling::{RecoverFromStall, StallMining};
2424
pub use tenure::MineBitcoinBlock;
25-
pub use transfer::SendTransferTxCommand;
25+
pub use transfer::SendTransferTx;

testnet/stacks-node/src/tests/signer/commands/shutdown.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ use madhouse::{Command, CommandWrapper};
44
use proptest::prelude::{Just, Strategy};
55
use std::sync::{Arc, Mutex};
66

7-
pub struct ShutdownMinersCommand {
7+
pub struct ShutdownMiners {
88
miners: Arc<Mutex<MultipleMinerTest>>,
99
}
1010

11-
impl ShutdownMinersCommand {
11+
impl ShutdownMiners {
1212
pub fn new(miners: Arc<Mutex<MultipleMinerTest>>) -> Self {
1313
Self { miners }
1414
}
1515
}
1616

17-
impl Command<SignerTestState, SignerTestContext> for ShutdownMinersCommand {
17+
impl Command<SignerTestState, SignerTestContext> for ShutdownMiners {
1818
fn check(&self, _state: &SignerTestState) -> bool {
1919
info!("Checking: Shutting down miners. Result: {:?}", true);
2020
true
@@ -37,7 +37,7 @@ impl Command<SignerTestState, SignerTestContext> for ShutdownMinersCommand {
3737
fn build(
3838
ctx: Arc<SignerTestContext>,
3939
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
40-
Just(CommandWrapper::new(ShutdownMinersCommand::new(
40+
Just(CommandWrapper::new(ShutdownMiners::new(
4141
ctx.miners.clone(),
4242
)))
4343
}

testnet/stacks-node/src/tests/signer/commands/stalling.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use madhouse::{Command, CommandWrapper};
33
use proptest::prelude::{Just, Strategy};
44
use std::sync::Arc;
55

6-
pub struct StallMiningCommand;
6+
pub struct StallMining;
77

8-
impl Command<SignerTestState, SignerTestContext> for StallMiningCommand {
8+
impl Command<SignerTestState, SignerTestContext> for StallMining {
99
fn check(&self, state: &SignerTestState) -> bool {
1010
info!(
1111
"Checking: Stalling mining. Result: {:?}",
@@ -27,13 +27,13 @@ impl Command<SignerTestState, SignerTestContext> for StallMiningCommand {
2727
fn build(
2828
_ctx: Arc<SignerTestContext>,
2929
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
30-
Just(CommandWrapper::new(StallMiningCommand))
30+
Just(CommandWrapper::new(StallMining))
3131
}
3232
}
3333

34-
pub struct RecoverFromStallCommand;
34+
pub struct RecoverFromStall;
3535

36-
impl Command<SignerTestState, SignerTestContext> for RecoverFromStallCommand {
36+
impl Command<SignerTestState, SignerTestContext> for RecoverFromStall {
3737
fn check(&self, state: &SignerTestState) -> bool {
3838
info!(
3939
"Checking: Recovering from mining stall. Result: {:?}",
@@ -55,6 +55,6 @@ impl Command<SignerTestState, SignerTestContext> for RecoverFromStallCommand {
5555
fn build(
5656
_ctx: Arc<SignerTestContext>,
5757
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
58-
Just(CommandWrapper::new(RecoverFromStallCommand))
58+
Just(CommandWrapper::new(RecoverFromStall))
5959
}
6060
}

testnet/stacks-node/src/tests/signer/commands/transfer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ use madhouse::{Command, CommandWrapper};
44
use proptest::prelude::{Just, Strategy};
55
use std::sync::{Arc, Mutex};
66

7-
pub struct SendTransferTxCommand {
7+
pub struct SendTransferTx {
88
miners: Arc<Mutex<MultipleMinerTest>>,
99
}
1010

11-
impl SendTransferTxCommand {
11+
impl SendTransferTx {
1212
pub fn new(miners: Arc<Mutex<MultipleMinerTest>>) -> Self {
1313
Self { miners }
1414
}
1515
}
1616

17-
impl Command<SignerTestState, SignerTestContext> for SendTransferTxCommand {
17+
impl Command<SignerTestState, SignerTestContext> for SendTransferTx {
1818
fn check(&self, _state: &SignerTestState) -> bool {
1919
info!("Checking: Sending transfer tx. Result: {:?}", true);
2020
true
@@ -33,7 +33,7 @@ impl Command<SignerTestState, SignerTestContext> for SendTransferTxCommand {
3333
fn build(
3434
ctx: Arc<SignerTestContext>,
3535
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
36-
Just(CommandWrapper::new(SendTransferTxCommand::new(
36+
Just(CommandWrapper::new(SendTransferTx::new(
3737
ctx.miners.clone(),
3838
)))
3939
}

testnet/stacks-node/src/tests/signer/v0.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10450,20 +10450,20 @@ fn allow_reorg_within_first_proposal_burn_block_timing_secs_scenario() {
1045010450
SkipCommitOpSecondaryMiner,
1045110451
BootToEpoch3,
1045210452
SkipCommitOpPrimaryMiner,
10453-
MineBitcoinBlockTenureChangePrimaryMinerCommand,
10454-
SubmitBlockCommitSecondaryMinerCommand,
10455-
StallMiningCommand,
10453+
MineBitcoinBlockTenureChangePrimaryMiner,
10454+
SubmitBlockCommitSecondaryMiner,
10455+
StallMining,
1045610456
MineBitcoinBlock,
10457-
SubmitBlockCommitPrimaryMinerCommand,
10458-
RecoverFromStallCommand,
10459-
WaitForBlockFromMiner2Command,
10457+
SubmitBlockCommitPrimaryMiner,
10458+
RecoverFromStall,
10459+
WaitForBlockFromMiner2,
1046010460
MineBitcoinBlock,
10461-
WaitForBlockFromMiner1Command,
10462-
SubmitBlockCommitPrimaryMinerCommand,
10463-
SendTransferTxCommand,
10464-
WaitForBlockFromMiner1Command,
10465-
MineBitcoinBlockTenureChangePrimaryMinerCommand,
10466-
ShutdownMinersCommand
10461+
WaitForBlockFromMiner1,
10462+
SubmitBlockCommitPrimaryMiner,
10463+
SendTransferTx,
10464+
WaitForBlockFromMiner1,
10465+
MineBitcoinBlockTenureChangePrimaryMiner,
10466+
ShutdownMiners
1046710467
]
1046810468
}
1046910469

0 commit comments

Comments
 (0)