From d03c2ceae3346738f22405c11d8c0945bedff9e2 Mon Sep 17 00:00:00 2001 From: ASuciuX Date: Wed, 27 Mar 2024 15:22:12 +0200 Subject: [PATCH] update the mutants for PR stacks-network#4561 --- stackslib/src/chainstate/stacks/miner.rs | 13 +++++++++---- testnet/stacks-node/src/config.rs | 3 +++ testnet/stacks-node/src/neon_node.rs | 7 ++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/stackslib/src/chainstate/stacks/miner.rs b/stackslib/src/chainstate/stacks/miner.rs index 066ce241dc..0ab876c04e 100644 --- a/stackslib/src/chainstate/stacks/miner.rs +++ b/stackslib/src/chainstate/stacks/miner.rs @@ -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 { @@ -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 { @@ -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>( @@ -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( diff --git a/testnet/stacks-node/src/config.rs b/testnet/stacks-node/src/config.rs index 7901b6d875..a43f677c0f 100644 --- a/testnet/stacks-node/src/config.rs +++ b/testnet/stacks-node/src/config.rs @@ -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, diff --git a/testnet/stacks-node/src/neon_node.rs b/testnet/stacks-node/src/neon_node.rs index 7f1034176c..0a5530b425 100644 --- a/testnet/stacks-node/src/neon_node.rs +++ b/testnet/stacks-node/src/neon_node.rs @@ -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 @@ -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, @@ -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 {