13#include <validation.h>
18static std::unique_ptr<CWallet> g_wallet_ptr;
20void initialize_setup()
22 static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
23 g_setup = testing_setup.get();
33 CWallet&
wallet = *g_wallet_ptr;
39 if (fuzzed_data_provider.ConsumeBool()) {
43 if (fuzzed_data_provider.ConsumeBool()) {
48 const auto tx_bytes{fuzzed_data_provider.ConsumeIntegral<
unsigned int>()};
50 if (fuzzed_data_provider.ConsumeBool()) {
58 CCoinControl coin_control;
59 if (fuzzed_data_provider.ConsumeBool()) {
62 if (fuzzed_data_provider.ConsumeBool()) {
63 coin_control.m_confirm_target = fuzzed_data_provider.ConsumeIntegralInRange<
unsigned int>(0, 999'000);
65 if (fuzzed_data_provider.ConsumeBool()) {
70 FeeCalculation* maybe_fee_calculation{fuzzed_data_provider.ConsumeBool() ? nullptr : &fee_calculation};
static constexpr CAmount COIN
The amount of satoshis in one BTC.
uint256 GetBlockHash() const
CBlockIndex * Tip() const
Returns the index entry for the tip of this chain, or nullptr if none.
int Height() const
Return the maximal height in the chain.
Fee rate in satoshis per kilovirtualbyte: CAmount / kvB.
Chainstate stores and provides an API to update our local knowledge of the current best chain.
CChain m_chain
The current chain of blockheaders we consult and build on.
@ CONSERVATIVE
Force estimateSmartFee to use conservative estimates.
@ ECONOMICAL
Force estimateSmartFee to use non-conservative estimates.
CFeeRate GetRequiredFeeRate(const CWallet &wallet)
Return the minimum required feerate taking into account the minimum relay feerate and user set minimu...
CAmount GetMinimumFee(const CWallet &wallet, unsigned int nTxBytes, const CCoinControl &coin_control, FeeCalculation *feeCalc)
Estimate the minimum fee considering user set parameters and the required fee.
CFeeRate GetMinimumFeeRate(const CWallet &wallet, const CCoinControl &coin_control, FeeCalculation *feeCalc)
Estimate the minimum fee rate considering user set parameters and the required fee.
FUZZ_TARGET(coin_grinder)
std::unique_ptr< WalletDatabase > CreateMockableWalletDatabase(MockableData records)
CFeeRate GetDiscardRate(const CWallet &wallet)
Return the maximum feerate for discarding change.
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.
CAmount ConsumeMoney(FuzzedDataProvider &fuzzed_data_provider, const std::optional< CAmount > &max) noexcept