aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/mini_miner.cpp
diff options
context:
space:
mode:
authorTheCharlatan <seb.kung@gmail.com>2024-04-21 10:03:21 +0200
committerTheCharlatan <seb.kung@gmail.com>2024-05-17 23:37:25 +0200
commit09ef322acc0a88a9e119f74923399598984c68f6 (patch)
tree267676aa64f40b55635c870efbf8847c7706991c /src/test/fuzz/mini_miner.cpp
parent3d24189664e696a2ca1aee2b5ea57b245344e2d4 (diff)
[[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.
Diffstat (limited to 'src/test/fuzz/mini_miner.cpp')
-rw-r--r--src/test/fuzz/mini_miner.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/test/fuzz/mini_miner.cpp b/src/test/fuzz/mini_miner.cpp
index 84f9bb4ad0..3a1663364f 100644
--- a/src/test/fuzz/mini_miner.cpp
+++ b/src/test/fuzz/mini_miner.cpp
@@ -7,11 +7,13 @@
#include <test/util/txmempool.h>
#include <test/util/mining.h>
-#include <node/mini_miner.h>
#include <node/miner.h>
+#include <node/mini_miner.h>
#include <primitives/transaction.h>
#include <random.h>
#include <txmempool.h>
+#include <util/check.h>
+#include <util/translation.h>
#include <deque>
#include <vector>
@@ -33,7 +35,9 @@ void initialize_miner()
FUZZ_TARGET(mini_miner, .init = initialize_miner)
{
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
- CTxMemPool pool{CTxMemPool::Options{}};
+ bilingual_str error;
+ CTxMemPool pool{CTxMemPool::Options{}, error};
+ Assert(error.empty());
std::vector<COutPoint> outpoints;
std::deque<COutPoint> available_coins = g_available_coins;
LOCK2(::cs_main, pool.cs);
@@ -109,7 +113,9 @@ FUZZ_TARGET(mini_miner, .init = initialize_miner)
FUZZ_TARGET(mini_miner_selection, .init = initialize_miner)
{
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
- CTxMemPool pool{CTxMemPool::Options{}};
+ bilingual_str error;
+ CTxMemPool pool{CTxMemPool::Options{}, error};
+ Assert(error.empty());
// Make a copy to preserve determinism.
std::deque<COutPoint> available_coins = g_available_coins;
std::vector<CTransactionRef> transactions;