aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-05-05 13:12:30 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-05-05 13:19:09 +0200
commitfaae7d5c00c99b0f3e99a1fbffbf369645716dd1 (patch)
treed14dd9b48c878c4d64e8c76ca8dfc43e045a7494
parentfa26e3462a0fb1a9ad116ed58afa6897798f2c24 (diff)
downloadbitcoin-faae7d5c00c99b0f3e99a1fbffbf369645716dd1.tar.xz
Move LoadVerifyActivateChainstate to ChainTestingSetup
-rw-r--r--src/test/util/setup_common.cpp8
-rw-r--r--src/test/util/setup_common.h10
2 files changed, 9 insertions, 9 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp
index ddc1e7ab37..fcd67543fe 100644
--- a/src/test/util/setup_common.cpp
+++ b/src/test/util/setup_common.cpp
@@ -211,7 +211,7 @@ ChainTestingSetup::~ChainTestingSetup()
m_node.chainman.reset();
}
-void TestingSetup::LoadVerifyActivateChainstate()
+void ChainTestingSetup::LoadVerifyActivateChainstate()
{
auto& chainman{*Assert(m_node.chainman)};
node::ChainstateLoadOptions options;
@@ -241,10 +241,10 @@ TestingSetup::TestingSetup(
const std::vector<const char*>& extra_args,
const bool coins_db_in_memory,
const bool block_tree_db_in_memory)
- : ChainTestingSetup(chainName, extra_args),
- m_coins_db_in_memory(coins_db_in_memory),
- m_block_tree_db_in_memory(block_tree_db_in_memory)
+ : ChainTestingSetup(chainName, extra_args)
{
+ m_coins_db_in_memory = coins_db_in_memory;
+ m_block_tree_db_in_memory = block_tree_db_in_memory;
// Ideally we'd move all the RPC tests to the functional testing framework
// instead of unit tests, but for now we need these here.
RegisterAllCoreRPCCommands(tableRPC);
diff --git a/src/test/util/setup_common.h b/src/test/util/setup_common.h
index 750f010fb0..62e025e819 100644
--- a/src/test/util/setup_common.h
+++ b/src/test/util/setup_common.h
@@ -93,19 +93,19 @@ struct BasicTestingSetup {
*/
struct ChainTestingSetup : public BasicTestingSetup {
node::CacheSizes m_cache_sizes{};
+ bool m_coins_db_in_memory{true};
+ bool m_block_tree_db_in_memory{true};
explicit ChainTestingSetup(const std::string& chainName = CBaseChainParams::MAIN, const std::vector<const char*>& extra_args = {});
~ChainTestingSetup();
+
+ // Supplies a chainstate, if one is needed
+ void LoadVerifyActivateChainstate();
};
/** Testing setup that configures a complete environment.
*/
struct TestingSetup : public ChainTestingSetup {
- bool m_coins_db_in_memory{true};
- bool m_block_tree_db_in_memory{true};
-
- void LoadVerifyActivateChainstate();
-
explicit TestingSetup(
const std::string& chainName = CBaseChainParams::MAIN,
const std::vector<const char*>& extra_args = {},