diff options
author | Carl Dong <contact@carldong.me> | 2020-10-27 18:17:51 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-06-10 15:04:39 -0400 |
commit | ee0ab1e959e0e75e04d87fabae8334ad4656f3e5 (patch) | |
tree | e555d83206216c21ca2a3a4f77707d401bbb429b /src/test/fuzz/load_external_block_file.cpp | |
parent | 0d61634c066a7102d539e85e2b1a4ca15be9660a (diff) | |
download | bitcoin-ee0ab1e959e0e75e04d87fabae8334ad4656f3e5.tar.xz |
fuzz: Initialize a TestingSetup for test_one_input
For fuzz tests that need it.
Diffstat (limited to 'src/test/fuzz/load_external_block_file.cpp')
-rw-r--r-- | src/test/fuzz/load_external_block_file.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/fuzz/load_external_block_file.cpp b/src/test/fuzz/load_external_block_file.cpp index dbd0c76d42..a7770c90e8 100644 --- a/src/test/fuzz/load_external_block_file.cpp +++ b/src/test/fuzz/load_external_block_file.cpp @@ -13,9 +13,14 @@ #include <cstdint> #include <vector> +namespace { +const TestingSetup* g_setup; +} // namespace + void initialize_load_external_block_file() { static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>(); + g_setup = testing_setup.get(); } FUZZ_TARGET_INIT(load_external_block_file, initialize_load_external_block_file) @@ -27,5 +32,5 @@ FUZZ_TARGET_INIT(load_external_block_file, initialize_load_external_block_file) return; } FlatFilePos flat_file_pos; - ::ChainstateActive().LoadExternalBlockFile(Params(), fuzzed_block_file, fuzzed_data_provider.ConsumeBool() ? &flat_file_pos : nullptr); + g_setup->m_node.chainman->ActiveChainstate().LoadExternalBlockFile(Params(), fuzzed_block_file, fuzzed_data_provider.ConsumeBool() ? &flat_file_pos : nullptr); } |