diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2021-12-01 18:16:29 -0500 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2022-07-19 15:54:52 -0500 |
commit | b3e7de7ee6efb186efc272855ff1af5d9254b971 (patch) | |
tree | fba09f8cb042e154a536c0f8fd577a7090465411 /src/test | |
parent | 3b91d4b9947adbec74721f538e46c712db22587c (diff) |
refactor: Reduce number of LoadChainstate return values
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/util/setup_common.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index db5937121b..67984721a3 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -225,11 +225,11 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const options.prune = node::fPruneMode; options.check_blocks = m_args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS); options.check_level = m_args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL); - auto maybe_load_error = LoadChainstate(*Assert(m_node.chainman), m_cache_sizes, options); - assert(!maybe_load_error.has_value()); + auto [status, error] = LoadChainstate(*Assert(m_node.chainman), m_cache_sizes, options); + assert(status == node::ChainstateLoadStatus::SUCCESS); - auto maybe_verify_error = VerifyLoadedChainstate(*Assert(m_node.chainman), options); - assert(!maybe_verify_error.has_value()); + std::tie(status, error) = VerifyLoadedChainstate(*Assert(m_node.chainman), options); + assert(status == node::ChainstateLoadStatus::SUCCESS); BlockValidationState state; if (!m_node.chainman->ActiveChainstate().ActivateBestChain(state)) { |