From fa07b8beb598642655b1207afd275b801ff8cec2 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 4 Nov 2019 11:00:37 -0500 Subject: [PATCH] test: Reset global args between test suites --- src/test/setup_common.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/test/setup_common.cpp b/src/test/setup_common.cpp index 73517f3f9bc..797b72ff59d 100644 --- a/src/test/setup_common.cpp +++ b/src/test/setup_common.cpp @@ -129,6 +129,7 @@ TestChain100Setup::TestChain100Setup() // CreateAndProcessBlock() does not support building SegWit blocks, so don't activate in these tests. // TODO: fix the code to support SegWit blocks. gArgs.ForceSetArg("-segwitheight", "432"); + // Need to recreate chainparams SelectParams(CBaseChainParams::REGTEST); // Generate a 100-block chain: @@ -142,12 +143,9 @@ TestChain100Setup::TestChain100Setup() } } -// // Create a new block with just given transactions, coinbase paying to // scriptPubKey, and try to add it to the current chain. -// -CBlock -TestChain100Setup::CreateAndProcessBlock(const std::vector& txns, const CScript& scriptPubKey) +CBlock TestChain100Setup::CreateAndProcessBlock(const std::vector& txns, const CScript& scriptPubKey) { const CChainParams& chainparams = Params(); std::unique_ptr pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey); @@ -175,6 +173,7 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector& TestChain100Setup::~TestChain100Setup() { + gArgs.ForceSetArg("-segwitheight", "0"); }