13 #include <validation.h> 18 static std::unique_ptr<CWallet> g_wallet_ptr;
20 void initialize_setup()
22 static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
23 g_setup = testing_setup.get();
24 const auto&
node{g_setup->m_node};
31 const auto&
node{g_setup->m_node};
33 CWallet&
wallet = *g_wallet_ptr;
39 if (fuzzed_data_provider.ConsumeBool()) {
44 const auto tx_bytes{fuzzed_data_provider.ConsumeIntegral<
unsigned int>()};
46 if (fuzzed_data_provider.ConsumeBool()) {
54 CCoinControl coin_control;
55 if (fuzzed_data_provider.ConsumeBool()) {
58 if (fuzzed_data_provider.ConsumeBool()) {
59 coin_control.m_confirm_target = fuzzed_data_provider.ConsumeIntegralInRange<
unsigned int>(0, 999
'000); 62 FeeCalculation fee_calculation; 63 FeeCalculation* maybe_fee_calculation{fuzzed_data_provider.ConsumeBool() ? nullptr : &fee_calculation}; 64 (void)GetMinimumFeeRate(wallet, coin_control, maybe_fee_calculation); 65 (void)GetMinimumFee(wallet, tx_bytes, coin_control, maybe_fee_calculation);
int Height() const
Return the maximal height in the chain.
CFeeRate GetDiscardRate(const CWallet &wallet)
Return the maximum feerate for discarding change.
CChain m_chain
The current chain of blockheaders we consult and build on.
FUZZ_TARGET(coinselection)
CFeeRate GetRequiredFeeRate(const CWallet &wallet)
Return the minimum required feerate taking into account the minimum relay feerate and user set minimu...
uint256 GetBlockHash() const
Chainstate stores and provides an API to update our local knowledge of the current best chain...
std::unique_ptr< WalletDatabase > CreateMockableWalletDatabase(MockableData records)
CAmount ConsumeMoney(FuzzedDataProvider &fuzzed_data_provider, const std::optional< CAmount > &max) noexcept
CBlockIndex * Tip() const
Returns the index entry for the tip of this chain, or nullptr if none.
Fee rate in satoshis per kilovirtualbyte: CAmount / kvB.
CAmount GetRequiredFee(const CWallet &wallet, unsigned int nTxBytes)
Return the minimum required absolute fee for this size based on the required fee rate.
Testing setup that configures a complete environment.
static constexpr CAmount COIN
The amount of satoshis in one BTC.