diff options
author | James O'Beirne <james.obeirne@pm.me> | 2021-12-03 11:57:56 -0500 |
---|---|---|
committer | James O'Beirne <james.obeirne@pm.me> | 2021-12-13 09:04:19 -0500 |
commit | 826e12b010eda4238f9e8cd875e8915a405bed0d (patch) | |
tree | 4308e73f8628c9aaed17151381e483e2968b5454 /src/test/util/setup_common.cpp | |
parent | bf66e258a84e18935fde3ebb9a4b0392bf883222 (diff) |
test: call VerifyLoadedChainstate during ChainTestingSetup
for additional coverage and similarity to actual init process.
Diffstat (limited to 'src/test/util/setup_common.cpp')
-rw-r--r-- | src/test/util/setup_common.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index d0be9fe73a..eb23e8725f 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -195,6 +195,16 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const true); assert(!rv.has_value()); + auto maybe_verify_failure = VerifyLoadedChainstate( + *Assert(m_node.chainman), + fReindex.load(), + m_args.GetBoolArg("-reindex-chainstate", false), + chainparams.GetConsensus(), + m_args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS), + m_args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL), + static_cast<int64_t(*)()>(GetTime)); + assert(!maybe_verify_failure.has_value()); + BlockValidationState state; if (!m_node.chainman->ActiveChainstate().ActivateBestChain(state)) { throw std::runtime_error(strprintf("ActivateBestChain failed. (%s)", state.ToString())); |