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

Function ConsumeTxMemPoolEntry

src/test/fuzz/util.cpp:461–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461CTxMemPoolEntry ConsumeTxMemPoolEntry(FuzzedDataProvider& fuzzed_data_provider, const CTransaction& tx) noexcept
462{
463 // Avoid:
464 // policy/feerate.cpp:28:34: runtime error: signed integer overflow: 34873208148477500 * 1000 cannot be represented in type 'long'
465 //
466 // Reproduce using CFeeRate(348732081484775, 10).GetFeePerK()
467 const CAmount fee = std::min<CAmount>(ConsumeMoney(fuzzed_data_provider), std::numeric_limits<CAmount>::max() / static_cast<CAmount>(100000));
468 assert(MoneyRange(fee));
469 const int64_t time = fuzzed_data_provider.ConsumeIntegral<int64_t>();
470 const unsigned int entry_height = fuzzed_data_provider.ConsumeIntegral<unsigned int>();
471 const bool spends_coinbase = fuzzed_data_provider.ConsumeBool();
472 const unsigned int sig_op_cost = fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(0, MAX_BLOCK_SIGOPS_COST);
473 std::set<std::pair<uint256, COutPoint>> setPeginsSpent;
474 return CTxMemPoolEntry{MakeTransactionRef(tx), fee, time, entry_height, spends_coinbase, sig_op_cost, {}, setPeginsSpent};
475}
476
477bool ContainsSpentInput(const CTransaction& tx, const CCoinsViewCache& inputs) noexcept
478{

Callers 2

FUZZ_TARGET_INITFunction · 0.85
FUZZ_TARGET_INITFunction · 0.85

Calls 4

ConsumeMoneyFunction · 0.85
ConsumeBoolMethod · 0.80
MoneyRangeFunction · 0.50
MakeTransactionRefFunction · 0.50

Tested by

no test coverage detected