5#include <bitcoin-build-config.h>
19#if defined(USE_BDB) && defined(USE_SQLITE)
25 const auto test_setup = MakeNoLogFileContext<TestingSetup>();
27 WalletContext context;
28 context.args = &test_setup->m_args;
29 context.chain = test_setup->m_node.chain.get();
32 int NUM_WATCH_ONLY_ADDR = 20;
35 DatabaseOptions options;
36 options.use_unsafe_sync =
true;
37 options.verify =
false;
41 uint64_t create_flags = 0;
45 std::vector<CScript> scripts_watch_only;
46 for (
int w = 0; w < NUM_WATCH_ONLY_ADDR; ++w) {
56 for (
int j = 0; j < 400; ++j) {
60 mtx.
vout.emplace_back(
COIN, scripts_watch_only.at(j % NUM_WATCH_ONLY_ADDR));
72 assert(res->watchonly_wallet);
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
static constexpr CAmount COIN
The amount of satoshis in one BTC.
#define Assert(val)
Identity function.
An encapsulated private key.
CPubKey GetPubKey() const
Compute the public key from a private key.
Serialized script, used inside transaction inputs and outputs.
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.
Bench & epochs(size_t numEpochs) noexcept
Controls number of epochs, the number of measurements to perform.
CKey GenerateRandomKey(bool compressed) noexcept
static std::string PathToString(const path &path)
Convert path object to a byte string.
BENCHMARK(WalletBalanceDirty, benchmark::PriorityLevel::HIGH)
std::shared_ptr< CWallet > TestLoadWallet(std::unique_ptr< WalletDatabase > database, WalletContext &context, uint64_t create_flags)
util::Result< MigrationResult > MigrateLegacyToDescriptor(const std::string &wallet_name, const SecureString &passphrase, WalletContext &context)
Do all steps to migrate a legacy wallet to a descriptor wallet.
void TestUnloadWallet(std::shared_ptr< CWallet > &&wallet)
std::unique_ptr< WalletDatabase > MakeWalletDatabase(const std::string &name, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error_string)
CTxDestination GetDestinationForKey(const CPubKey &key, OutputType type)
Get a destination of the requested type (if possible) to the specified key.
static CTransactionRef MakeTransactionRef(Tx &&txIn)
A mutable version of CTransaction.
std::vector< CTxOut > vout