diff options
author | Carl Dong <contact@carldong.me> | 2021-12-08 16:19:31 -0500 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2022-06-28 16:08:34 -0400 |
commit | d1684beabe5b738c2cc83de83e1aaef11a761b69 (patch) | |
tree | 78a19775e3c20969688f8cfee621efdb4049f736 /src/test/fuzz/policy_estimator_io.cpp | |
parent | 9a3d825c30e8e6118d74a4e568744cb9d03f7f5d (diff) |
fees: Pass in a filepath instead of referencing gArgs
Diffstat (limited to 'src/test/fuzz/policy_estimator_io.cpp')
-rw-r--r-- | src/test/fuzz/policy_estimator_io.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/fuzz/policy_estimator_io.cpp b/src/test/fuzz/policy_estimator_io.cpp index 9021d95954..77402c260a 100644 --- a/src/test/fuzz/policy_estimator_io.cpp +++ b/src/test/fuzz/policy_estimator_io.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <policy/fees.h> +#include <policy/fees_args.h> #include <test/fuzz/FuzzedDataProvider.h> #include <test/fuzz/fuzz.h> #include <test/fuzz/util.h> @@ -11,9 +12,14 @@ #include <cstdint> #include <vector> +namespace { +const BasicTestingSetup* g_setup; +} // namespace + void initialize_policy_estimator_io() { static const auto testing_setup = MakeNoLogFileContext<>(); + g_setup = testing_setup.get(); } FUZZ_TARGET_INIT(policy_estimator_io, initialize_policy_estimator_io) @@ -22,7 +28,7 @@ FUZZ_TARGET_INIT(policy_estimator_io, initialize_policy_estimator_io) FuzzedAutoFileProvider fuzzed_auto_file_provider = ConsumeAutoFile(fuzzed_data_provider); CAutoFile fuzzed_auto_file = fuzzed_auto_file_provider.open(); // Re-using block_policy_estimator across runs to avoid costly creation of CBlockPolicyEstimator object. - static CBlockPolicyEstimator block_policy_estimator; + static CBlockPolicyEstimator block_policy_estimator{FeeestPath(*g_setup->m_node.args)}; if (block_policy_estimator.Read(fuzzed_auto_file)) { block_policy_estimator.Write(fuzzed_auto_file); } |