25 static const auto testing_setup = MakeNoLogFileContext<>();
26 g_setup = testing_setup.get();
37 const std::optional<CMutableTransaction> mtx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider);
42 block_policy_estimator.processTransaction(
ConsumeTxMemPoolEntry(fuzzed_data_provider, tx), fuzzed_data_provider.ConsumeBool());
43 if (fuzzed_data_provider.ConsumeBool()) {
44 (void)block_policy_estimator.removeTx(tx.GetHash(), fuzzed_data_provider.ConsumeBool());
48 std::vector<CTxMemPoolEntry> mempool_entries;
50 const std::optional<CMutableTransaction> mtx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider);
57 std::vector<const CTxMemPoolEntry*> ptrs;
58 ptrs.reserve(mempool_entries.size());
60 ptrs.push_back(&mempool_entry);
62 block_policy_estimator.processBlock(fuzzed_data_provider.ConsumeIntegral<
unsigned int>(), ptrs);
65 (void)block_policy_estimator.removeTx(
ConsumeUInt256(fuzzed_data_provider), fuzzed_data_provider.ConsumeBool());
68 block_policy_estimator.FlushUnconfirmed();
70 (void)block_policy_estimator.estimateFee(fuzzed_data_provider.ConsumeIntegral<
int>());
72 (void)block_policy_estimator.estimateRawFee(fuzzed_data_provider.ConsumeIntegral<
int>(), fuzzed_data_provider.ConsumeFloatingPoint<
double>(), fuzzed_data_provider.PickValueInArray(
ALL_FEE_ESTIMATE_HORIZONS), fuzzed_data_provider.ConsumeBool() ? &result :
nullptr);
74 (void)block_policy_estimator.estimateSmartFee(fuzzed_data_provider.ConsumeIntegral<
int>(), fuzzed_data_provider.ConsumeBool() ? &fee_calculation :
nullptr, fuzzed_data_provider.ConsumeBool());
79 AutoFile fuzzed_auto_file{fuzzed_auto_file_provider.
open()};
80 block_policy_estimator.Write(fuzzed_auto_file);
81 block_policy_estimator.Read(fuzzed_auto_file);
fs::path FeeestPath(const ArgsManager &argsman)
CTxMemPoolEntry ConsumeTxMemPoolEntry(FuzzedDataProvider &fuzzed_data_provider, const CTransaction &tx) noexcept
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
FUZZ_TARGET_INIT(policy_estimator, initialize_policy_estimator)
Non-refcounted RAII wrapper for FILE*.
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool...
FuzzedAutoFileProvider ConsumeAutoFile(FuzzedDataProvider &fuzzed_data_provider) noexcept
static constexpr auto ALL_FEE_ESTIMATE_HORIZONS
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)
The basic transaction that is broadcasted on the network and contained in blocks. ...
uint256 ConsumeUInt256(FuzzedDataProvider &fuzzed_data_provider) noexcept
void initialize_policy_estimator()