Skip to content

Commit 32dfc7a

Browse files
committed
Reference Bitcoin/Stacks in commands to avoid confusion
1 parent af2d015 commit 32dfc7a

File tree

6 files changed

+33
-28
lines changed

6 files changed

+33
-28
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ use proptest::prelude::Strategy;
66
use super::context::{SignerTestContext, SignerTestState};
77

88
/// Command to manually trigger a block commit submission for a specified miner
9-
pub struct MinerSubmitBlockCommit {
9+
pub struct MinerSubmitNakaBlockCommit {
1010
ctx: Arc<SignerTestContext>,
1111
miner_index: usize,
1212
}
1313

14-
impl MinerSubmitBlockCommit {
14+
impl MinerSubmitNakaBlockCommit {
1515
pub fn new(ctx: Arc<SignerTestContext>, miner_index: usize) -> Self {
1616
Self { ctx, miner_index }
1717
}
1818
}
1919

20-
impl Command<SignerTestState, SignerTestContext> for MinerSubmitBlockCommit {
20+
impl Command<SignerTestState, SignerTestContext> for MinerSubmitNakaBlockCommit {
2121
fn check(&self, _state: &SignerTestState) -> bool {
2222
let is_miner_paused = self
2323
.ctx
@@ -77,7 +77,7 @@ impl Command<SignerTestState, SignerTestContext> for MinerSubmitBlockCommit {
7777
ctx: Arc<SignerTestContext>,
7878
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
7979
(1usize..=2usize).prop_map(move |miner_index| {
80-
CommandWrapper::new(MinerSubmitBlockCommit::new(ctx.clone(), miner_index))
80+
CommandWrapper::new(MinerSubmitNakaBlockCommit::new(ctx.clone(), miner_index))
8181
})
8282
}
8383
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use super::context::{SignerTestContext, SignerTestState};
77

88
/// Command to verify that a specified miner has produced the expected number of blocks
99
/// based on different height calculation strategies.
10-
pub struct ChainVerifyMinerBlockCount {
10+
pub struct ChainVerifyMinerNakaBlockCount {
1111
ctx: Arc<SignerTestContext>,
1212
miner_index: usize,
1313
expected_block_count: usize,
@@ -20,7 +20,7 @@ enum HeightStrategy {
2020
AfterSpecificHeight(u64),
2121
}
2222

23-
impl ChainVerifyMinerBlockCount {
23+
impl ChainVerifyMinerNakaBlockCount {
2424
fn new(
2525
ctx: Arc<SignerTestContext>,
2626
miner_index: usize,
@@ -63,7 +63,7 @@ impl ChainVerifyMinerBlockCount {
6363
}
6464
}
6565

66-
impl Command<SignerTestState, SignerTestContext> for ChainVerifyMinerBlockCount {
66+
impl Command<SignerTestState, SignerTestContext> for ChainVerifyMinerNakaBlockCount {
6767
fn check(&self, _state: &SignerTestState) -> bool {
6868
info!(
6969
"Checking: Verifying miner {} block count. Result: {}",
@@ -121,7 +121,7 @@ impl Command<SignerTestState, SignerTestContext> for ChainVerifyMinerBlockCount
121121
ctx: Arc<SignerTestContext>,
122122
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
123123
(1usize..=2usize, 1usize..=5usize).prop_map(move |(miner_index, expected_block_count)| {
124-
CommandWrapper::new(ChainVerifyMinerBlockCount::after_boot_to_epoch3(
124+
CommandWrapper::new(ChainVerifyMinerNakaBlockCount::after_boot_to_epoch3(
125125
ctx.clone(),
126126
miner_index,
127127
expected_block_count,

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,22 +328,22 @@ impl Command<SignerTestState, SignerTestContext> for ChainExpectNakaBlockProposa
328328
}
329329

330330
/// Command to wait for a tenure change block from a specific miner.
331-
/// This command waits for a block that contains exactly 2 transactions:
331+
/// This command waits for a block that contains:
332332
/// 1. A TenureChange transaction with cause BlockFound
333333
/// 2. A Coinbase transaction
334334
/// This verifies that a proper tenure change has occurred.
335-
pub struct ChainExpectTenureChange {
335+
pub struct ChainExpectStacksTenureChange {
336336
ctx: Arc<SignerTestContext>,
337337
miner_index: usize,
338338
}
339339

340-
impl ChainExpectTenureChange {
340+
impl ChainExpectStacksTenureChange {
341341
pub fn new(ctx: Arc<SignerTestContext>, miner_index: usize) -> Self {
342342
Self { ctx, miner_index }
343343
}
344344
}
345345

346-
impl Command<SignerTestState, SignerTestContext> for ChainExpectTenureChange {
346+
impl Command<SignerTestState, SignerTestContext> for ChainExpectStacksTenureChange {
347347
fn check(&self, _state: &SignerTestState) -> bool {
348348
info!(
349349
"Checking: Waiting for tenure change block from miner {}",
@@ -403,7 +403,7 @@ impl Command<SignerTestState, SignerTestContext> for ChainExpectTenureChange {
403403
ctx: Arc<SignerTestContext>,
404404
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
405405
(1usize..=2usize).prop_flat_map(move |miner_index| {
406-
Just(CommandWrapper::new(ChainExpectTenureChange::new(
406+
Just(CommandWrapper::new(ChainExpectStacksTenureChange::new(
407407
ctx.clone(),
408408
miner_index,
409409
)))

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ mod stacks_mining;
1212
mod transfer;
1313

1414
pub use bitcoin_mining::{ChainGenerateBitcoinBlocks, MinerMineBitcoinBlocks};
15-
pub use block_commit::MinerSubmitBlockCommit;
16-
pub use block_verify::ChainVerifyMinerBlockCount;
17-
pub use block_wait::{ChainExpectNakaBlock, ChainExpectNakaBlockProposal, ChainExpectTenureChange};
15+
pub use block_commit::MinerSubmitNakaBlockCommit;
16+
pub use block_verify::ChainVerifyMinerNakaBlockCount;
17+
pub use block_wait::{
18+
ChainExpectNakaBlock, ChainExpectNakaBlockProposal, ChainExpectStacksTenureChange,
19+
};
1820
pub use boot::ChainBootToEpoch3;
1921
pub use commit_ops::ChainMinerCommitOp;
2022
pub use context::SignerTestContext;
2123
pub use shutdown::ChainShutdownMiners;
2224
pub use sortition::{ChainExpectSortitionWinner, ChainVerifyLastSortitionWinnerReorged};
2325
pub use stacks_mining::ChainStacksMining;
24-
pub use transfer::MinerSendAndMineTransferTx;
26+
pub use transfer::MinerSendAndMineStacksTransferTx;

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ use crate::tests::neon_integrations::get_chain_info;
88

99
// This command simulates sending a Stacks transfer transaction and then mining a block to confirm it.
1010
// It verifies that the Stacks chain height increases as expected after the mining operation.
11-
pub struct MinerSendAndMineTransferTx {
11+
pub struct MinerSendAndMineStacksTransferTx {
1212
ctx: Arc<SignerTestContext>,
1313
timeout_secs: u64,
1414
}
1515

16-
impl MinerSendAndMineTransferTx {
16+
impl MinerSendAndMineStacksTransferTx {
1717
pub fn new(ctx: Arc<SignerTestContext>, timeout_secs: u64) -> Self {
1818
Self { ctx, timeout_secs }
1919
}
2020
}
2121

22-
impl Command<SignerTestState, SignerTestContext> for MinerSendAndMineTransferTx {
22+
impl Command<SignerTestState, SignerTestContext> for MinerSendAndMineStacksTransferTx {
2323
fn check(&self, _state: &SignerTestState) -> bool {
2424
info!(
2525
"Checking: Send and mine transfer tx with timeout {} seconds",
@@ -62,7 +62,10 @@ impl Command<SignerTestState, SignerTestContext> for MinerSendAndMineTransferTx
6262
) -> impl Strategy<Value = CommandWrapper<SignerTestState, SignerTestContext>> {
6363
(20u64..40u64).prop_map(move |timeout_secs| {
6464
// Originally, timeout was 30 seconds
65-
CommandWrapper::new(MinerSendAndMineTransferTx::new(ctx.clone(), timeout_secs))
65+
CommandWrapper::new(MinerSendAndMineStacksTransferTx::new(
66+
ctx.clone(),
67+
timeout_secs,
68+
))
6669
})
6770
}
6871
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11299,7 +11299,7 @@ fn allow_reorg_within_first_proposal_burn_block_timing_secs_scenario() {
1129911299
(ChainStacksMining::pause()),
1130011300
(MinerMineBitcoinBlocks::one(test_context.clone())),
1130111301
(ChainExpectSortitionWinner::new(test_context.clone(), MINER1)),
11302-
(MinerSubmitBlockCommit::new(test_context.clone(), MINER2)),
11302+
(MinerSubmitNakaBlockCommit::new(test_context.clone(), MINER2)),
1130311303
(ChainStacksMining::resume()),
1130411304
(ChainExpectNakaBlock::from_miner_height(test_context.clone(), MINER1)),
1130511305
(MinerMineBitcoinBlocks::one(test_context.clone())),
@@ -11487,25 +11487,25 @@ fn disallow_reorg_within_first_proposal_burn_block_timing_secs_but_more_than_one
1148711487
ChainBootToEpoch3,
1148811488
(ChainMinerCommitOp::disable_for(test_context.clone(), MINER1)),
1148911489
(MinerMineBitcoinBlocks::one(test_context.clone())), // Sets block height in the state
11490-
(ChainExpectTenureChange::new(test_context.clone(), MINER1)),
11490+
(ChainExpectStacksTenureChange::new(test_context.clone(), MINER1)),
1149111491
(ChainExpectNakaBlock::from_state_height(test_context.clone(), MINER1)), // Uses block height from the state
1149211492
(ChainExpectSortitionWinner::new(test_context.clone(), MINER1)),
11493-
(MinerSubmitBlockCommit::new(test_context.clone(), MINER2)),
11493+
(MinerSubmitNakaBlockCommit::new(test_context.clone(), MINER2)),
1149411494
(ChainStacksMining::pause()),
1149511495
(MinerMineBitcoinBlocks::one(test_context.clone())),
11496-
(MinerSubmitBlockCommit::new(test_context.clone(), MINER1)),
11496+
(MinerSubmitNakaBlockCommit::new(test_context.clone(), MINER1)),
1149711497
(ChainStacksMining::resume()),
1149811498
(ChainExpectNakaBlock::from_miner_height(test_context.clone(), MINER2)),
1149911499
(ChainExpectSortitionWinner::new(test_context.clone(), MINER2)),
11500-
MinerSendAndMineTransferTx,
11501-
MinerSendAndMineTransferTx,
11500+
MinerSendAndMineStacksTransferTx,
11501+
MinerSendAndMineStacksTransferTx,
1150211502
(ChainGenerateBitcoinBlocks::one(test_context.clone())),
1150311503
(ChainExpectNakaBlockProposal::with_rejection(
1150411504
test_context.clone(),
1150511505
MINER1,
1150611506
RejectReason::ReorgNotAllowed
1150711507
)),
11508-
(ChainVerifyMinerBlockCount::after_boot_to_epoch3(test_context.clone(), MINER1, 1)), // FIXME: This takes the expected block count as a parameter - can we avoid that?
11508+
(ChainVerifyMinerNakaBlockCount::after_boot_to_epoch3(test_context.clone(), MINER1, 1)), // FIXME: This takes the expected block count as a parameter - can we avoid that?
1150911509
ChainShutdownMiners, // FIXME: miners.shutdown() says: Cannot shutdown miners: other references to Arc still exist
1151011510
]
1151111511
}

0 commit comments

Comments
 (0)