mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
Move LoadVerifyActivateChainstate to ChainTestingSetup
This commit is contained in:
parent
fa26e3462a
commit
faae7d5c00
2 changed files with 9 additions and 9 deletions
|
@ -211,7 +211,7 @@ ChainTestingSetup::~ChainTestingSetup()
|
||||||
m_node.chainman.reset();
|
m_node.chainman.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestingSetup::LoadVerifyActivateChainstate()
|
void ChainTestingSetup::LoadVerifyActivateChainstate()
|
||||||
{
|
{
|
||||||
auto& chainman{*Assert(m_node.chainman)};
|
auto& chainman{*Assert(m_node.chainman)};
|
||||||
node::ChainstateLoadOptions options;
|
node::ChainstateLoadOptions options;
|
||||||
|
@ -241,10 +241,10 @@ TestingSetup::TestingSetup(
|
||||||
const std::vector<const char*>& extra_args,
|
const std::vector<const char*>& extra_args,
|
||||||
const bool coins_db_in_memory,
|
const bool coins_db_in_memory,
|
||||||
const bool block_tree_db_in_memory)
|
const bool block_tree_db_in_memory)
|
||||||
: ChainTestingSetup(chainName, extra_args),
|
: ChainTestingSetup(chainName, extra_args)
|
||||||
m_coins_db_in_memory(coins_db_in_memory),
|
|
||||||
m_block_tree_db_in_memory(block_tree_db_in_memory)
|
|
||||||
{
|
{
|
||||||
|
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
|
// Ideally we'd move all the RPC tests to the functional testing framework
|
||||||
// instead of unit tests, but for now we need these here.
|
// instead of unit tests, but for now we need these here.
|
||||||
RegisterAllCoreRPCCommands(tableRPC);
|
RegisterAllCoreRPCCommands(tableRPC);
|
||||||
|
|
|
@ -93,19 +93,19 @@ struct BasicTestingSetup {
|
||||||
*/
|
*/
|
||||||
struct ChainTestingSetup : public BasicTestingSetup {
|
struct ChainTestingSetup : public BasicTestingSetup {
|
||||||
node::CacheSizes m_cache_sizes{};
|
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 = {});
|
explicit ChainTestingSetup(const std::string& chainName = CBaseChainParams::MAIN, const std::vector<const char*>& extra_args = {});
|
||||||
~ChainTestingSetup();
|
~ChainTestingSetup();
|
||||||
|
|
||||||
|
// Supplies a chainstate, if one is needed
|
||||||
|
void LoadVerifyActivateChainstate();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Testing setup that configures a complete environment.
|
/** Testing setup that configures a complete environment.
|
||||||
*/
|
*/
|
||||||
struct TestingSetup : public ChainTestingSetup {
|
struct TestingSetup : public ChainTestingSetup {
|
||||||
bool m_coins_db_in_memory{true};
|
|
||||||
bool m_block_tree_db_in_memory{true};
|
|
||||||
|
|
||||||
void LoadVerifyActivateChainstate();
|
|
||||||
|
|
||||||
explicit TestingSetup(
|
explicit TestingSetup(
|
||||||
const std::string& chainName = CBaseChainParams::MAIN,
|
const std::string& chainName = CBaseChainParams::MAIN,
|
||||||
const std::vector<const char*>& extra_args = {},
|
const std::vector<const char*>& extra_args = {},
|
||||||
|
|
Loading…
Add table
Reference in a new issue