[[refactor]] Check CTxMemPool options in constructor

This ensures that the tests run the same checks on the mempool options
that the init code also applies.
This commit is contained in:
TheCharlatan
2024-04-21 10:03:21 +02:00
parent 3d24189664
commit 09ef322acc
11 changed files with 83 additions and 30 deletions

View File

@@ -14,8 +14,10 @@
#include <test/util/txmempool.h>
#include <txmempool.h>
#include <uint256.h>
#include <util/check.h>
#include <util/strencodings.h>
#include <util/time.h>
#include <util/translation.h>
#include <validation.h>
#include <versionbits.h>
@@ -46,7 +48,9 @@ struct MinerTestingSetup : public TestingSetup {
// pointer is not accessed, when the new one should be accessed
// instead.
m_node.mempool.reset();
m_node.mempool = std::make_unique<CTxMemPool>(MemPoolOptionsForTest(m_node));
bilingual_str error;
m_node.mempool = std::make_unique<CTxMemPool>(MemPoolOptionsForTest(m_node), error);
Assert(error.empty());
return *m_node.mempool;
}
BlockAssembler AssemblerForTest(CTxMemPool& tx_mempool);