mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Switch testing framework from MAIN to new UNITTEST network
UNITTEST inherites from MAIN but allows synamically changing its parameters using the ModifiableParams() interface
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
41150d601d
commit
a25fd6be13
@@ -57,6 +57,20 @@ public:
|
||||
};
|
||||
static CBaseRegTestParams regTestParams;
|
||||
|
||||
//
|
||||
// Unit test
|
||||
//
|
||||
class CBaseUnitTestParams : public CBaseMainParams
|
||||
{
|
||||
public:
|
||||
CBaseUnitTestParams()
|
||||
{
|
||||
networkID = CBaseChainParams::UNITTEST;
|
||||
strDataDir = "unittest";
|
||||
}
|
||||
};
|
||||
static CBaseUnitTestParams unitTestParams;
|
||||
|
||||
static CBaseChainParams* pCurrentBaseParams = 0;
|
||||
|
||||
const CBaseChainParams& BaseParams()
|
||||
@@ -77,6 +91,9 @@ void SelectBaseParams(CBaseChainParams::Network network)
|
||||
case CBaseChainParams::REGTEST:
|
||||
pCurrentBaseParams = ®TestParams;
|
||||
break;
|
||||
case CBaseChainParams::UNITTEST:
|
||||
pCurrentBaseParams = &unitTestParams;
|
||||
break;
|
||||
default:
|
||||
assert(false && "Unimplemented network");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user