MCPcopy Create free account
hub / github.com/ElementsProject/elements / FUZZ_TARGET

Function FUZZ_TARGET

src/test/fuzz/fees.cpp:16–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#include <vector>
15
16FUZZ_TARGET(fees)
17{
18 FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
19 const CFeeRate minimal_incremental_fee{ConsumeMoney(fuzzed_data_provider)};
20 FeeFilterRounder fee_filter_rounder{minimal_incremental_fee};
21 LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 10000) {
22 const CAmount current_minimum_fee = ConsumeMoney(fuzzed_data_provider);
23 const CAmount rounded_fee = fee_filter_rounder.round(current_minimum_fee);
24 assert(MoneyRange(rounded_fee));
25 }
26 const FeeReason fee_reason = fuzzed_data_provider.PickValueInArray({FeeReason::NONE, FeeReason::HALF_ESTIMATE, FeeReason::FULL_ESTIMATE, FeeReason::DOUBLE_ESTIMATE, FeeReason::CONSERVATIVE, FeeReason::MEMPOOL_MIN, FeeReason::PAYTXFEE, FeeReason::FALLBACK, FeeReason::REQUIRED});
27 (void)StringForFeeReason(fee_reason);
28}

Callers

nothing calls this directly

Calls 8

ConsumeMoneyFunction · 0.85
StringForFeeReasonFunction · 0.85
ConsumeBoolMethod · 0.80
roundMethod · 0.80
PickValueInArrayMethod · 0.80
MoneyRangeFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected