test: Have segwit always active in (Basic)TestingSetup

This commit is contained in:
MarcoFalke 2019-04-10 15:58:11 -04:00
parent 6a135fbe5b
commit 666696b673
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -42,9 +42,6 @@ BasicTestingSetup::BasicTestingSetup(const std::string& chainName)
InitSignatureCache(); InitSignatureCache();
InitScriptExecutionCache(); InitScriptExecutionCache();
fCheckBlockIndex = true; fCheckBlockIndex = true;
// CreateAndProcessBlock() does not support building SegWit blocks, so don't activate in these tests.
// TODO: fix the code to support SegWit blocks.
gArgs.ForceSetArg("-vbparams", strprintf("segwit:0:%d", (int64_t)Consensus::BIP9Deployment::NO_TIMEOUT));
SelectParams(chainName); SelectParams(chainName);
noui_connect(); noui_connect();
} }
@ -115,6 +112,11 @@ TestingSetup::~TestingSetup()
TestChain100Setup::TestChain100Setup() : TestingSetup(CBaseChainParams::REGTEST) TestChain100Setup::TestChain100Setup() : TestingSetup(CBaseChainParams::REGTEST)
{ {
// CreateAndProcessBlock() does not support building SegWit blocks, so don't activate in these tests.
// TODO: fix the code to support SegWit blocks.
gArgs.ForceSetArg("-vbparams", strprintf("segwit:0:%d", (int64_t)Consensus::BIP9Deployment::NO_TIMEOUT));
SelectParams(CBaseChainParams::REGTEST);
// Generate a 100-block chain: // Generate a 100-block chain:
coinbaseKey.MakeNewKey(true); coinbaseKey.MakeNewKey(true);
CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG; CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG;