Skip to content

Commit 930d837

Browse files
committed
[test] add chainparams property to indicate chain allows time mocking
1 parent 1cd43e8 commit 930d837

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/chainparams.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ class CMainParams : public CChainParams {
135135
fDefaultConsistencyChecks = false;
136136
fRequireStandard = true;
137137
m_is_test_chain = false;
138+
m_is_mockable_chain = false;
138139

139140
checkpointData = {
140141
{
@@ -231,7 +232,7 @@ class CTestNetParams : public CChainParams {
231232
fDefaultConsistencyChecks = false;
232233
fRequireStandard = false;
233234
m_is_test_chain = true;
234-
235+
m_is_mockable_chain = false;
235236

236237
checkpointData = {
237238
{
@@ -303,6 +304,7 @@ class CRegTestParams : public CChainParams {
303304
fDefaultConsistencyChecks = true;
304305
fRequireStandard = true;
305306
m_is_test_chain = true;
307+
m_is_mockable_chain = true;
306308

307309
checkpointData = {
308310
{

src/chainparams.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class CChainParams
6868
bool RequireStandard() const { return fRequireStandard; }
6969
/** If this chain is exclusively used for testing */
7070
bool IsTestChain() const { return m_is_test_chain; }
71+
/** If this chain allows time to be mocked */
72+
bool IsMockableChain() const { return m_is_mockable_chain; }
7173
uint64_t PruneAfterHeight() const { return nPruneAfterHeight; }
7274
/** Minimum free space (in GB) needed for data directory */
7375
uint64_t AssumedBlockchainSize() const { return m_assumed_blockchain_size; }
@@ -102,6 +104,7 @@ class CChainParams
102104
bool fDefaultConsistencyChecks;
103105
bool fRequireStandard;
104106
bool m_is_test_chain;
107+
bool m_is_mockable_chain;
105108
CCheckpointData checkpointData;
106109
ChainTxData chainTxData;
107110
};

0 commit comments

Comments
 (0)