aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/validation_load_mempool.cpp
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2020-10-27 18:17:51 -0400
committerCarl Dong <contact@carldong.me>2021-06-10 15:04:39 -0400
commitee0ab1e959e0e75e04d87fabae8334ad4656f3e5 (patch)
treee555d83206216c21ca2a3a4f77707d401bbb429b /src/test/fuzz/validation_load_mempool.cpp
parent0d61634c066a7102d539e85e2b1a4ca15be9660a (diff)
fuzz: Initialize a TestingSetup for test_one_input
For fuzz tests that need it.
Diffstat (limited to 'src/test/fuzz/validation_load_mempool.cpp')
-rw-r--r--src/test/fuzz/validation_load_mempool.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/fuzz/validation_load_mempool.cpp b/src/test/fuzz/validation_load_mempool.cpp
index e1a21b6c53..c2aaf486c5 100644
--- a/src/test/fuzz/validation_load_mempool.cpp
+++ b/src/test/fuzz/validation_load_mempool.cpp
@@ -14,9 +14,14 @@
#include <cstdint>
#include <vector>
+namespace {
+const TestingSetup* g_setup;
+} // namespace
+
void initialize_validation_load_mempool()
{
static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
+ g_setup = testing_setup.get();
}
FUZZ_TARGET_INIT(validation_load_mempool, initialize_validation_load_mempool)
@@ -29,6 +34,6 @@ FUZZ_TARGET_INIT(validation_load_mempool, initialize_validation_load_mempool)
auto fuzzed_fopen = [&](const fs::path&, const char*) {
return fuzzed_file_provider.open();
};
- (void)LoadMempool(pool, ::ChainstateActive(), fuzzed_fopen);
+ (void)LoadMempool(pool, g_setup->m_node.chainman->ActiveChainstate(), fuzzed_fopen);
(void)DumpMempool(pool, fuzzed_fopen, true);
}