diff options
author | MacroFake <falke.marco@gmail.com> | 2022-08-11 19:48:02 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-08-11 19:48:07 +0200 |
commit | e5d8b654239789d2302bee3eb55d37ec1a3339e6 (patch) | |
tree | 573332888e2e35ebda5d2084ee242d2c485d1e97 /src/test/validation_flush_tests.cpp | |
parent | e078ee9d9d0a7505c38cf22ee4cc757bf31b62c0 (diff) | |
parent | 2e79fb6585c802813f80080fc2cadc5b54ddebfb (diff) |
Merge bitcoin/bitcoin#25815: test: Use existing {Chainstate,Block}Man
2e79fb6585c802813f80080fc2cadc5b54ddebfb validation tests: Use existing {Chainstate,Block}Man (Carl Dong)
Pull request description:
This is split up because it is needed for two changes:
* https://github.com/bitcoin/bitcoin/pull/25781
* https://github.com/bitcoin/bitcoin/pull/25623
ACKs for top commit:
adam2k:
ACK tested 2e79fb6585c802813f80080fc2cadc5b54ddebfb
aureleoules:
ACK 2e79fb6585c802813f80080fc2cadc5b54ddebfb.
Tree-SHA512: 2cd6a2fec19545f8ffc77e37ccb793aa6cb5815bb1b5e560c0345af6e0f890fd500ae3297b044d3f6f613b8dd7fd4553f5fc2824013342b9e25af1fe2b624967
Diffstat (limited to 'src/test/validation_flush_tests.cpp')
-rw-r--r-- | src/test/validation_flush_tests.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/test/validation_flush_tests.cpp b/src/test/validation_flush_tests.cpp index 012169b17e..74b2af6858 100644 --- a/src/test/validation_flush_tests.cpp +++ b/src/test/validation_flush_tests.cpp @@ -4,14 +4,11 @@ // #include <sync.h> #include <test/util/setup_common.h> -#include <txmempool.h> #include <validation.h> #include <boost/test/unit_test.hpp> -using node::BlockManager; - -BOOST_FIXTURE_TEST_SUITE(validation_flush_tests, ChainTestingSetup) +BOOST_FIXTURE_TEST_SUITE(validation_flush_tests, TestingSetup) //! Test utilities for detecting when we need to flush the coins cache based //! on estimated memory usage. @@ -20,11 +17,7 @@ BOOST_FIXTURE_TEST_SUITE(validation_flush_tests, ChainTestingSetup) //! BOOST_AUTO_TEST_CASE(getcoinscachesizestate) { - CTxMemPool& mempool = *Assert(m_node.mempool); - BlockManager blockman{}; - CChainState chainstate{&mempool, blockman, *Assert(m_node.chainman)}; - chainstate.InitCoinsDB(/*cache_size_bytes=*/1 << 10, /*in_memory=*/true, /*should_wipe=*/false); - WITH_LOCK(::cs_main, chainstate.InitCoinsCache(1 << 10)); + CChainState& chainstate{m_node.chainman->ActiveChainstate()}; constexpr bool is_64_bit = sizeof(void*) == 8; |