9 #include <test/util/mining.h>
10 #include <test/util/setup_common.h>
11 #include <test/util/wallet.h>
17 TestingSetup test_setup{
25 const auto& ADDRESS_WATCHONLY = ADDRESS_BCRT1_UNSPENDABLE;
31 wallet.SetupLegacyScriptPubKeyMan();
35 auto handler = chain->handleNotifications({&wallet, [](
CWallet*) {}});
40 for (
int i = 0; i < 100; ++i) {
41 generatetoaddress(test_setup.m_node, address_mine.get_value_or(ADDRESS_WATCHONLY));
46 auto bal = wallet.GetBalance();
49 if (set_dirty) wallet.MarkDirty();
50 bal = wallet.GetBalance();
51 if (add_mine) assert(bal.m_mine_trusted > 0);
52 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 pro...
static const std::string REGTEST
static void WalletBalanceDirty(benchmark::Bench &bench)
static auto & nullopt
Substitute for C++17 std::nullopt.
static RPCHelpMan generatetoaddress()
std::unique_ptr< Chain > MakeChain(NodeContext &node)
Return implementation of Chain interface.
BENCHMARK(WalletBalanceDirty)
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
NodeContext struct containing references to chain state and connection state.
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)
bool(* handler)(const util::Ref &context, HTTPRequest *req, const std::string &strReq)
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.
boost::optional< T > Optional
Substitute for C++17 std::optional.