26 static const auto testing_setup = MakeNoLogFileContext<>();
27 g_setup = testing_setup.get();
41 const std::optional<CMutableTransaction> mtx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider,
TX_WITH_WITNESS);
48 const auto tx_submitted_in_package = fuzzed_data_provider.
ConsumeBool();
49 const auto tx_has_mempool_parents = fuzzed_data_provider.
ConsumeBool();
53 tx_submitted_in_package,
55 tx_has_mempool_parents);
56 block_policy_estimator.processTransaction(tx_info);
58 (void)block_policy_estimator.removeTx(tx.GetHash());
62 std::list<CTxMemPoolEntry> mempool_entries;
65 const std::optional<CMutableTransaction> mtx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider,
TX_WITH_WITNESS);
73 std::vector<RemovedMempoolTransactionInfo> txs;
74 txs.reserve(mempool_entries.size());
76 txs.emplace_back(mempool_entry);
78 block_policy_estimator.processBlock(txs, fuzzed_data_provider.
ConsumeIntegral<
unsigned int>());
81 (void)block_policy_estimator.removeTx(
ConsumeUInt256(fuzzed_data_provider));
84 block_policy_estimator.FlushUnconfirmed();
86 (void)block_policy_estimator.estimateFee(fuzzed_data_provider.
ConsumeIntegral<
int>());
91 auto* result_ptr = fuzzed_data_provider.
ConsumeBool() ? &result :
nullptr;
92 (void)block_policy_estimator.estimateRawFee(conf_target, success_threshold, horizon, result_ptr);
96 auto* fee_calc_ptr = fuzzed_data_provider.
ConsumeBool() ? &fee_calculation :
nullptr;
97 auto conservative = fuzzed_data_provider.
ConsumeBool();
98 (void)block_policy_estimator.estimateSmartFee(conf_target, fee_calc_ptr, conservative);
104 AutoFile fuzzed_auto_file{fuzzed_file_provider.open()};
105 block_policy_estimator.Write(fuzzed_auto_file);
106 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...
unsigned int GetHeight() const
CTransactionRef GetSharedTx() const
int32_t GetTxSize() const
const CAmount & GetFee() const
static constexpr ExplicitCopyTag ExplicitCopy
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 bool DEFAULT_ACCEPT_STALE_FEE_ESTIMATES
static constexpr auto ALL_FEE_ESTIMATE_HORIZONS
void initialize_policy_estimator()
FUZZ_TARGET(policy_estimator,.init=initialize_policy_estimator)
static constexpr TransactionSerParams TX_WITH_WITNESS
CTxMemPoolEntry ConsumeTxMemPoolEntry(FuzzedDataProvider &fuzzed_data_provider, const CTransaction &tx) noexcept
uint256 ConsumeUInt256(FuzzedDataProvider &fuzzed_data_provider) noexcept
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)