aboutsummaryrefslogtreecommitdiff
path: root/src/test/mempool_tests.cpp
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2022-06-27 15:47:00 -0400
committerCarl Dong <contact@carldong.me>2022-06-28 15:36:36 -0400
commit386c9472c8764738282e6d163b42e15a8feda7ea (patch)
treee1598d961ceba7cee592cfd3234633e8e66ff99c /src/test/mempool_tests.cpp
parent82f00de7a6a60cbc9ad0c6e1d0ffb1bc70c49af5 (diff)
mempool: Make GetMinFee() with custom size protected
The version of GetMinFee() with a custom size specification is and should only be used by tests. Mark it as protected and use a derived class exposing GetMinFee() as public in tests.
Diffstat (limited to 'src/test/mempool_tests.cpp')
-rw-r--r--src/test/mempool_tests.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp
index bc63122025..8c745b07b9 100644
--- a/src/test/mempool_tests.cpp
+++ b/src/test/mempool_tests.cpp
@@ -16,6 +16,12 @@ BOOST_FIXTURE_TEST_SUITE(mempool_tests, TestingSetup)
static constexpr auto REMOVAL_REASON_DUMMY = MemPoolRemovalReason::REPLACED;
+class MemPoolTest final : public CTxMemPool
+{
+public:
+ using CTxMemPool::GetMinFee;
+};
+
BOOST_AUTO_TEST_CASE(MempoolRemoveTest)
{
// Test CTxMemPool::remove functionality
@@ -423,7 +429,7 @@ BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest)
BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
{
- CTxMemPool& pool = *Assert(m_node.mempool);
+ auto& pool = static_cast<MemPoolTest&>(*Assert(m_node.mempool));
LOCK2(cs_main, pool.cs);
TestMemPoolEntryHelper entry;