Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/test/block_reward_reallocation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<CTransactionRef>& txs)
Expand Down
5 changes: 1 addition & 4 deletions src/test/dynamic_activation_thresholds_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
8 changes: 2 additions & 6 deletions src/test/util/setup_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,9 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
}
}

TestChainSetup::TestChainSetup(int blockCount)
TestChainSetup::TestChainSetup(int blockCount, const std::vector<const char*>& extra_args)
: RegTestingSetup(extra_args)
{
// Make sure CreateAndProcessBlock() support building <deployment_name> blocks before activating it in these tests.
//gArgs.ForceSetArg("-vbparams", strprintf("deployment_name:0:%d", (int64_t)Consensus::BIP9Deployment::NO_TIMEOUT));
// Need to recreate chainparams
SelectParams(CBaseChainParams::REGTEST);

// Generate a 100-block chain:
coinbaseKey.MakeNewKey(true);
CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG;
Expand Down
6 changes: 3 additions & 3 deletions src/test/util/setup_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<const char*>& extra_args = {})
: TestingSetup{CBaseChainParams::REGTEST, extra_args} {}
};

class CBlock;
Expand All @@ -112,7 +112,7 @@ class CScript;

struct TestChainSetup : public RegTestingSetup
{
TestChainSetup(int blockCount);
TestChainSetup(int blockCount, const std::vector<const char*>& extra_args = {});
~TestChainSetup();

/**
Expand Down