10#include <validation.h>
28 void SetFeeEstimator(std::unique_ptr<CBlockPolicyEstimator> fee_estimator)
34FeeEstimatorTestingSetup*
g_setup;
76 std::unique_ptr<CBlockPolicyEstimator> fee_estimator = std::make_unique<FuzzedBlockPolicyEstimator>(
fuzzed_data_provider);
77 g_setup->SetFeeEstimator(std::move(fee_estimator));
83 std::unique_ptr<CWallet>
wallet_ptr{std::make_unique<CWallet>(
node.chain.get(),
"", CreateMockableWalletDatabase())};
static constexpr CAmount COIN
The amount of satoshis in one BTC.
const TestingSetup * g_setup
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
Fee rate in satoshis per virtualbyte: CAmount / vB the feerate is represented internally as FeeFrac.
FeePerVSize m_feerate
Fee rate in sats/vB (satoshis per N virtualbytes)
Chainstate stores and provides an API to update our local knowledge of the current best chain.
T ConsumeIntegralInRange(T min, T max)
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.
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.
Options struct containing options for constructing a CTxMemPool.
CFeeRate incremental_relay_feerate
std::unique_ptr< CBlockPolicyEstimator > fee_estimator
NodeSeconds ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
CAmount ConsumeMoney(FuzzedDataProvider &fuzzed_data_provider, const std::optional< CAmount > &max) noexcept
void SeedRandomStateForTest(SeedRand seedtype)
Seed the global RNG state for testing and log the seed value.
@ ZEROS
Seed with a compile time constant of zeros.
void MockMempoolMinFee(const CFeeRate &target_feerate, CTxMemPool &mempool)
Mock the mempool minimum feerate by adding a transaction and calling TrimToSize(0),...
@ CONSERVATIVE
Force estimateSmartFee to use conservative estimates.
@ ECONOMICAL
Force estimateSmartFee to use non-conservative estimates.
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
FuzzedDataProvider & fuzzed_data_provider