mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 03:03:22 -03:00
test: Reset global args between test suites
This commit is contained in:
parent
fba574c908
commit
fa07b8beb5
1 changed files with 3 additions and 4 deletions
|
@ -129,6 +129,7 @@ TestChain100Setup::TestChain100Setup()
|
||||||
// CreateAndProcessBlock() does not support building SegWit blocks, so don't activate in these tests.
|
// CreateAndProcessBlock() does not support building SegWit blocks, so don't activate in these tests.
|
||||||
// TODO: fix the code to support SegWit blocks.
|
// TODO: fix the code to support SegWit blocks.
|
||||||
gArgs.ForceSetArg("-segwitheight", "432");
|
gArgs.ForceSetArg("-segwitheight", "432");
|
||||||
|
// Need to recreate chainparams
|
||||||
SelectParams(CBaseChainParams::REGTEST);
|
SelectParams(CBaseChainParams::REGTEST);
|
||||||
|
|
||||||
// Generate a 100-block chain:
|
// Generate a 100-block chain:
|
||||||
|
@ -142,12 +143,9 @@ TestChain100Setup::TestChain100Setup()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Create a new block with just given transactions, coinbase paying to
|
// Create a new block with just given transactions, coinbase paying to
|
||||||
// scriptPubKey, and try to add it to the current chain.
|
// scriptPubKey, and try to add it to the current chain.
|
||||||
//
|
CBlock TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>& txns, const CScript& scriptPubKey)
|
||||||
CBlock
|
|
||||||
TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>& txns, const CScript& scriptPubKey)
|
|
||||||
{
|
{
|
||||||
const CChainParams& chainparams = Params();
|
const CChainParams& chainparams = Params();
|
||||||
std::unique_ptr<CBlockTemplate> pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey);
|
std::unique_ptr<CBlockTemplate> pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey);
|
||||||
|
@ -175,6 +173,7 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>&
|
||||||
|
|
||||||
TestChain100Setup::~TestChain100Setup()
|
TestChain100Setup::~TestChain100Setup()
|
||||||
{
|
{
|
||||||
|
gArgs.ForceSetArg("-segwitheight", "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue