Skip to content

Commit faae7d5

Browse files
author
MarcoFalke
committed
Move LoadVerifyActivateChainstate to ChainTestingSetup
1 parent fa26e34 commit faae7d5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/test/util/setup_common.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ ChainTestingSetup::~ChainTestingSetup()
211211
m_node.chainman.reset();
212212
}
213213

214-
void TestingSetup::LoadVerifyActivateChainstate()
214+
void ChainTestingSetup::LoadVerifyActivateChainstate()
215215
{
216216
auto& chainman{*Assert(m_node.chainman)};
217217
node::ChainstateLoadOptions options;
@@ -241,10 +241,10 @@ TestingSetup::TestingSetup(
241241
const std::vector<const char*>& extra_args,
242242
const bool coins_db_in_memory,
243243
const bool block_tree_db_in_memory)
244-
: ChainTestingSetup(chainName, extra_args),
245-
m_coins_db_in_memory(coins_db_in_memory),
246-
m_block_tree_db_in_memory(block_tree_db_in_memory)
244+
: ChainTestingSetup(chainName, extra_args)
247245
{
246+
m_coins_db_in_memory = coins_db_in_memory;
247+
m_block_tree_db_in_memory = block_tree_db_in_memory;
248248
// Ideally we'd move all the RPC tests to the functional testing framework
249249
// instead of unit tests, but for now we need these here.
250250
RegisterAllCoreRPCCommands(tableRPC);

src/test/util/setup_common.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,19 @@ struct BasicTestingSetup {
9393
*/
9494
struct ChainTestingSetup : public BasicTestingSetup {
9595
node::CacheSizes m_cache_sizes{};
96+
bool m_coins_db_in_memory{true};
97+
bool m_block_tree_db_in_memory{true};
9698

9799
explicit ChainTestingSetup(const std::string& chainName = CBaseChainParams::MAIN, const std::vector<const char*>& extra_args = {});
98100
~ChainTestingSetup();
101+
102+
// Supplies a chainstate, if one is needed
103+
void LoadVerifyActivateChainstate();
99104
};
100105

101106
/** Testing setup that configures a complete environment.
102107
*/
103108
struct TestingSetup : public ChainTestingSetup {
104-
bool m_coins_db_in_memory{true};
105-
bool m_block_tree_db_in_memory{true};
106-
107-
void LoadVerifyActivateChainstate();
108-
109109
explicit TestingSetup(
110110
const std::string& chainName = CBaseChainParams::MAIN,
111111
const std::vector<const char*>& extra_args = {},

0 commit comments

Comments
 (0)