6#include <bitcoin-build-config.h>
28 auto test_setup = MakeNoLogFileContext<TestingSetup>();
32 context.
args = &test_setup->m_args;
33 context.
chain = test_setup->m_node.chain.get();
46 std::vector<bilingual_str> warnings;
48 auto wallet_path =
fs::PathToString(test_setup->m_path_root /
"test_wallet");
50 auto wallet =
CreateWallet(context, wallet_path, std::nullopt, options, status, error_string, warnings);
57 fs::remove_all(wallet_path);
uint256 rand256() noexcept
generate a random uint256.
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.
std::string ToString() const
static std::string PathToString(const path &path)
Convert path object to a byte string.
static void WalletCreate(benchmark::Bench &bench, bool encrypted)
BENCHMARK(WalletBalanceDirty, benchmark::PriorityLevel::HIGH)
std::shared_ptr< CWallet > CreateWallet(WalletContext &context, const std::string &name, std::optional< bool > load_on_start, DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings)
@ WALLET_FLAG_DESCRIPTORS
Indicate that this wallet supports DescriptorScriptPubKeyMan.
void WaitForDeleteWallet(std::shared_ptr< CWallet > &&wallet)
Explicitly delete the wallet.
static void WalletCreatePlain(benchmark::Bench &bench)
bool RemoveWallet(WalletContext &context, const std::shared_ptr< CWallet > &wallet, std::optional< bool > load_on_start, std::vector< bilingual_str > &warnings)
static void WalletCreateEncrypted(benchmark::Bench &bench)
SecureString create_passphrase
std::optional< DatabaseFormat > require_format
WalletContext struct containing references to state shared between CWallet instances,...
interfaces::Chain * chain