Skip to content

Commit

Permalink
update the mutants for PR stacks-network#4561
Browse files Browse the repository at this point in the history
  • Loading branch information
ASuciuX committed Mar 27, 2024
1 parent 304b44d commit d03c2ce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
13 changes: 9 additions & 4 deletions stackslib/src/chainstate/stacks/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ pub struct BlockBuilderSettings {
}

impl BlockBuilderSettings {
/// TODO: #4587 create default for `BlockBuilderSettings` and then tests the cases returning it
///TODO: #4587 create default for BlockBuilderSettings, then check if mutation tests are caught for these case:
/// Default::default()
/// Or keep the skip and remove the comment
#[cfg_attr(test, mutants::skip)]
pub fn limited() -> BlockBuilderSettings {
Expand All @@ -182,7 +183,8 @@ impl BlockBuilderSettings {
}
}

/// TODO: #4587 create default for `BlockBuilderSettings` and then tests the cases returning it
///TODO: #4587 create default for BlockBuilderSettings, then check if mutation tests are caught for these case:
/// Default::default()
/// Or keep the skip and remove the comment
#[cfg_attr(test, mutants::skip)]
pub fn max_value() -> BlockBuilderSettings {
Expand Down Expand Up @@ -1806,7 +1808,8 @@ impl StacksBlockBuilder {
/// of the burn tip, burn tip height + 1, the parent microblock stream,
/// the parent consensus hash, the parent header hash, and a bool
/// representing whether the network is mainnet or not.
/// TODO: #4587 create default for `MinerEpochInfo` and then tests the cases returning it
/// TODO: #4587 create default for MinerEpochInfo, then check if mutation tests are caught for these case:
/// Ok(Default::default())
/// Or keep the skip and remove the comment
#[cfg_attr(test, mutants::skip)]
pub fn pre_epoch_begin<'a>(
Expand Down Expand Up @@ -2395,7 +2398,9 @@ impl StacksBlockBuilder {

/// Given access to the mempool, mine an anchored block with no more than the given execution cost.
/// returns the assembled block, and the consumed execution budget.
/// TODO: #4587 add default for `StacksBlock` and `ExecutionCost`, then check if mutation tests are caught, and if not add tests
/// TODO: #4587 create default for StacksBlock and ExecutionCost, then check if mutation tests are caught for these cases:
/// Ok((Default::default(), Default::default(), 1))
/// Ok((Default::default(), Default::default(), 0))
/// Or keep the skip and remove the comment
#[cfg_attr(test, mutants::skip)]
pub fn build_anchored_block(
Expand Down
3 changes: 3 additions & 0 deletions testnet/stacks-node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,9 @@ impl Config {
self.events_observers.len() > 0
}

///TODO: #4587 create default for BlockBuilderSettings, then check if mutation tests are caught for these case:
/// Default::default()
#[cfg_attr(test, mutants::skip)]
pub fn make_block_builder_settings(
&self,
attempt: u64,
Expand Down
7 changes: 4 additions & 3 deletions testnet/stacks-node/src/neon_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2185,7 +2185,8 @@ impl BlockMinerThread {
debug!("block miner thread ID is {:?}", thread::current().id());
fault_injection_long_tenure();

let burn_db_path = self.config.get_burn_db_file_path();
let burn_db_path = self.config.get_burn_db_file_pa
th();
let stacks_chainstate_path = self.config.get_chainstate_path_str();

let cost_estimator = self
Expand Down Expand Up @@ -3056,7 +3057,7 @@ impl RelayerThread {
/// Update the miner tip if we won the highest tenure (or clear it if we didn't).
/// If we won any sortitions, send the block and microblock data to the p2p thread.
/// Return true if we can still continue to run; false if not.
/// TODO: #4587 add test for the `true` and `false` return cases
/// TODO: #4587 add tests for `true` and `false` returning cases
#[cfg_attr(test, mutants::skip)]
pub fn process_new_tenures(
&mut self,
Expand Down Expand Up @@ -3509,7 +3510,7 @@ impl RelayerThread {

/// See if we should run a microblock tenure now.
/// Return true if so; false if not
/// TODO: #4587 add test for the `true` and `false` return cases
/// TODO: #4587 add tests for `true` and `false` returning cases
#[cfg_attr(test, mutants::skip)]
fn can_run_microblock_tenure(&mut self) -> bool {
if !self.config.node.mine_microblocks {
Expand Down

0 comments on commit d03c2ce

Please sign in to comment.