15#include <validation.h>
29 const auto test_setup = MakeNoLogFileContext<const TestingSetup>();
35 SetMockTime(test_setup->m_node.chainman->GetParams().GenesisBlock().nTime);
40 wallet.SetupDescriptorScriptPubKeyMans();
44 const std::optional<std::string> address_mine{add_mine ? std::optional<std::string>{
getnewaddress(
wallet)} : std::nullopt};
46 for (
int i = 0; i < 100; ++i) {
56 if (set_dirty)
wallet.MarkDirty();
58 if (add_mine)
assert(bal.m_mine_trusted > 0);
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
static const uint256 ZERO
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Balance GetBalance(const CWallet &wallet, const int min_depth, bool avoid_reuse)
BENCHMARK(WalletBalanceDirty, benchmark::PriorityLevel::HIGH)
const std::string ADDRESS_BCRT1_UNSPENDABLE
static void WalletBalanceDirty(benchmark::Bench &bench)
std::unique_ptr< WalletDatabase > CreateMockableWalletDatabase(MockableData records)
static void WalletBalance(benchmark::Bench &bench, const bool set_dirty, const bool add_mine)
static void WalletBalanceWatch(benchmark::Bench &bench)
@ WALLET_FLAG_DESCRIPTORS
Indicate that this wallet supports DescriptorScriptPubKeyMan.
RPCHelpMan getnewaddress()
static void WalletBalanceMine(benchmark::Bench &bench)
static void WalletBalanceClean(benchmark::Bench &bench)
bool(* handler)(const std::any &context, HTTPRequest *req, const std::string &strReq)
static RPCHelpMan generatetoaddress()
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.