21 const auto test_setup = MakeNoLogFileContext<const TestingSetup>();
27 SetMockTime(test_setup->m_node.chainman->GetParams().GenesisBlock().nTime);
32 wallet.SetupDescriptorScriptPubKeyMans();
36 const std::optional<std::string> address_mine{add_mine ? std::optional<std::string>{
getnewaddress(
wallet)} : std::nullopt};
38 for (
int i = 0; i < 100; ++i) {
47 if (set_dirty)
wallet.MarkDirty();
49 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.
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)
std::shared_ptr< CWallet > wallet
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.
void SyncWithValidationInterfaceQueue()
This is a synonym for the following, which asserts certain locks are not held: std::promise<void> pro...