diff --git a/src/test/block_reward_reallocation_tests.cpp b/src/test/block_reward_reallocation_tests.cpp index 9ea3664070..17a910b979 100644 --- a/src/test/block_reward_reallocation_tests.cpp +++ b/src/test/block_reward_reallocation_tests.cpp @@ -40,13 +40,8 @@ const int window{500}, th_start{400}, th_end{300}; struct TestChainBRRBeforeActivationSetup : public TestChainSetup { - TestChainBRRBeforeActivationSetup() : TestChainSetup(497) - { - // Force fast DIP3 activation - gArgs.ForceSetArg("-dip3params", "30:50"); - SelectParams(CBaseChainParams::REGTEST); - gArgs.ForceRemoveArg("dip3params"); - } + // Force fast DIP3 activation + TestChainBRRBeforeActivationSetup() : TestChainSetup(497, {"-dip3params=30:50"}) {} }; static SimpleUTXOMap BuildSimpleUtxoMap(const std::vector& txs) diff --git a/src/test/dynamic_activation_thresholds_tests.cpp b/src/test/dynamic_activation_thresholds_tests.cpp index 0692256f9f..9d9b5cfe4f 100644 --- a/src/test/dynamic_activation_thresholds_tests.cpp +++ b/src/test/dynamic_activation_thresholds_tests.cpp @@ -34,10 +34,7 @@ static constexpr int threshold(int attempt) struct TestChainDATSetup : public TestChainSetup { - TestChainDATSetup() : TestChainSetup(window - 2) { - gArgs.ForceSetArg("-vbparams","testdummy:0:999999999999:100:80:60:5"); - SelectParams(CBaseChainParams::REGTEST); - } + TestChainDATSetup() : TestChainSetup(window - 2, {"-vbparams=testdummy:0:999999999999:100:80:60:5"}) {} void signal(int num_blocks, bool expected_lockin) { diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index a0ee3bfe58..cd4a36f9ed 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -259,7 +259,8 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector& extra_args) + : RegTestingSetup(extra_args) { // Generate a 100-block chain: coinbaseKey.MakeNewKey(true); diff --git a/src/test/util/setup_common.h b/src/test/util/setup_common.h index d69dd73dbd..bd9a41a533 100644 --- a/src/test/util/setup_common.h +++ b/src/test/util/setup_common.h @@ -102,8 +102,8 @@ struct TestingSetup : public ChainTestingSetup { /** Identical to TestingSetup, but chain set to regtest */ struct RegTestingSetup : public TestingSetup { - RegTestingSetup() - : TestingSetup{CBaseChainParams::REGTEST} {} + RegTestingSetup(const std::vector& extra_args = {}) + : TestingSetup{CBaseChainParams::REGTEST, extra_args} {} }; class CBlock; @@ -112,7 +112,7 @@ class CScript; struct TestChainSetup : public RegTestingSetup { - TestChainSetup(int blockCount); + TestChainSetup(int blockCount, const std::vector& extra_args = {}); ~TestChainSetup(); /**