aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2022-01-18 21:34:16 +1000
committerAnthony Towns <aj@erisian.com.au>2022-05-10 12:09:27 +1000
commit69675ea4e73dcf5e9dd0f94802bd3463e4262081 (patch)
treefd28492424413d54e5e84f75d3118529b0b82071 /src/test
parenta8098f2cef53ec003edae91100afce564e9c6f23 (diff)
validation: add CChainParams to ChainstateManager
Diffstat (limited to 'src/test')
-rw-r--r--src/test/util/setup_common.cpp4
-rw-r--r--src/test/validation_chainstate_tests.cpp3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp
index 2fc71c2a6e..aa7b73e6ac 100644
--- a/src/test/util/setup_common.cpp
+++ b/src/test/util/setup_common.cpp
@@ -151,6 +151,8 @@ BasicTestingSetup::~BasicTestingSetup()
ChainTestingSetup::ChainTestingSetup(const std::string& chainName, const std::vector<const char*>& extra_args)
: BasicTestingSetup(chainName, extra_args)
{
+ const CChainParams& chainparams = Params();
+
// We have to run a scheduler thread to prevent ActivateBestChain
// from blocking due to queue overrun.
m_node.scheduler = std::make_unique<CScheduler>();
@@ -162,7 +164,7 @@ ChainTestingSetup::ChainTestingSetup(const std::string& chainName, const std::ve
m_cache_sizes = CalculateCacheSizes(m_args);
- m_node.chainman = std::make_unique<ChainstateManager>();
+ m_node.chainman = std::make_unique<ChainstateManager>(chainparams);
m_node.chainman->m_blockman.m_block_tree_db = std::make_unique<CBlockTreeDB>(m_cache_sizes.block_tree_db, true);
// Start script-checking threads. Set g_parallel_script_checks to true so they are used.
diff --git a/src/test/validation_chainstate_tests.cpp b/src/test/validation_chainstate_tests.cpp
index 2a3990bb7c..e7c7584f1c 100644
--- a/src/test/validation_chainstate_tests.cpp
+++ b/src/test/validation_chainstate_tests.cpp
@@ -22,7 +22,8 @@ BOOST_FIXTURE_TEST_SUITE(validation_chainstate_tests, TestingSetup)
//!
BOOST_AUTO_TEST_CASE(validation_chainstate_resize_caches)
{
- ChainstateManager manager;
+ const CChainParams& chainparams = Params();
+ ChainstateManager manager(chainparams);
WITH_LOCK(::cs_main, manager.m_blockman.m_block_tree_db = std::make_unique<CBlockTreeDB>(1 << 20, true));
CTxMemPool mempool;