16#include <validation.h>
30 const auto test_setup = MakeNoLogFileContext<const TestingSetup>();
36 NodeClockContext clock_ctx{test_setup->m_node.chainman->GetParams().GenesisBlock().Time()};
41 wallet.SetupDescriptorScriptPubKeyMans();
45 const std::optional<std::string> address_mine{add_mine ? std::optional<std::string>{
getnewaddress(
wallet)} : std::nullopt};
47 for (
int i = 0; i < 100; ++i) {
57 if (set_dirty)
wallet.MarkDirty();
59 if (add_mine)
assert(bal.m_mine_trusted > 0);
Helper to initialize the global NodeClock, let a duration elapse, and reset it after use in a test.
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...
std::unique_ptr< WalletDatabase > CreateMockableWalletDatabase()
const std::string ADDRESS_BCRT1_UNSPENDABLE
static void WalletBalanceDirty(benchmark::Bench &bench)
static void WalletBalance(benchmark::Bench &bench, const bool set_dirty, const bool add_mine)
static void WalletBalanceWatch(benchmark::Bench &bench)
Balance GetBalance(const CWallet &wallet, const int min_depth, bool avoid_reuse, bool include_nonmempool)
@ WALLET_FLAG_DESCRIPTORS
Indicate that this wallet supports DescriptorScriptPubKeyMan.
RPCMethod getnewaddress()
static void WalletBalanceClean(benchmark::Bench &bench)
bool(* handler)(const std::any &context, HTTPRequest *req, const std::string &strReq)
static RPCMethod generatetoaddress()