8 #include <test/util/mining.h> 9 #include <test/util/setup_common.h> 10 #include <test/util/wallet.h> 18 const auto test_setup = MakeNoLogFileContext<const TestingSetup>();
20 const auto& ADDRESS_WATCHONLY = ADDRESS_BCRT1_UNSPENDABLE;
24 wallet.SetupLegacyScriptPubKeyMan();
29 const std::optional<std::string> address_mine{add_mine ? std::optional<std::string>{
getnewaddress(
wallet)} : std::nullopt};
32 for (
int i = 0; i < 100; ++i) {
38 auto bal =
wallet.GetBalance();
41 if (set_dirty)
wallet.MarkDirty();
43 if (add_mine)
assert(bal.m_mine_trusted > 0);
44 if (add_watchonly)
assert(bal.m_watchonly_trusted > 0);
std::unique_ptr< WalletDatabase > CreateMockWalletDatabase()
Return object for accessing temporary in-memory database.
void SyncWithValidationInterfaceQueue()
This is a synonym for the following, which asserts certain locks are not held: std::promise<void> pro...
static void WalletBalanceDirty(benchmark::Bench &bench)
bool(* handler)(const std::any &context, HTTPRequest *req, const std::string &strReq)
static RPCHelpMan generatetoaddress()
BENCHMARK(WalletBalanceDirty)
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
static void WalletBalanceClean(benchmark::Bench &bench)
RPCHelpMan importaddress()
static void WalletBalanceMine(benchmark::Bench &bench)
static void WalletBalance(benchmark::Bench &bench, const bool set_dirty, const bool add_watchonly, const bool add_mine)
static void WalletBalanceWatch(benchmark::Bench &bench)
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
static RPCHelpMan getnewaddress()
Main entry point to nanobench's benchmarking facility.