14 #include <txmempool.h>
27 static const auto testing_setup = MakeNoLogFileContext<>();
28 g_setup = testing_setup.get();
39 const std::optional<CMutableTransaction> mtx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider);
46 (void)block_policy_estimator.removeTx(tx.GetHash(), fuzzed_data_provider.
ConsumeBool());
50 std::vector<CTxMemPoolEntry> mempool_entries;
52 const std::optional<CMutableTransaction> mtx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider);
59 std::vector<const CTxMemPoolEntry*> ptrs;
60 ptrs.reserve(mempool_entries.size());
62 ptrs.push_back(&mempool_entry);
64 block_policy_estimator.processBlock(fuzzed_data_provider.
ConsumeIntegral<
unsigned int>(), ptrs);
70 block_policy_estimator.FlushUnconfirmed();
72 (void)block_policy_estimator.estimateFee(fuzzed_data_provider.
ConsumeIntegral<
int>());
76 (void)block_policy_estimator.estimateSmartFee(fuzzed_data_provider.
ConsumeIntegral<
int>(), fuzzed_data_provider.
ConsumeBool() ? &fee_calculation :
nullptr, fuzzed_data_provider.
ConsumeBool());
81 AutoFile fuzzed_auto_file{fuzzed_auto_file_provider.
open()};
82 block_policy_estimator.Write(fuzzed_auto_file);
83 block_policy_estimator.Read(fuzzed_auto_file);
Non-refcounted RAII wrapper for FILE*.
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
The basic transaction that is broadcasted on the network and contained in blocks.
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool...
T PickValueInArray(const T(&array)[size])
fs::path FeeestPath(const ArgsManager &argsman)
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
static constexpr auto ALL_FEE_ESTIMATE_HORIZONS
void initialize_policy_estimator()
FUZZ_TARGET_INIT(policy_estimator, initialize_policy_estimator)
CTxMemPoolEntry ConsumeTxMemPoolEntry(FuzzedDataProvider &fuzzed_data_provider, const CTransaction &tx) noexcept
FuzzedAutoFileProvider ConsumeAutoFile(FuzzedDataProvider &fuzzed_data_provider) noexcept
uint256 ConsumeUInt256(FuzzedDataProvider &fuzzed_data_provider) noexcept
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)