38 const auto test_setup{MakeNoLogFileContext<TestingSetup>()};
39 const auto loader{
MakeWalletLoader(*test_setup->m_node.chain, test_setup->m_args)};
42 int NUM_WATCH_ONLY_ADDR = 20;
45 std::vector<std::pair<CScript, CTxDestination>> scripts_watch_only;
46 for (
int w = 0; w < NUM_WATCH_ONLY_ADDR; ++w) {
53 std::vector<CKey>
keys(500);
56 std::unique_ptr<CWallet>
wallet;
69 batch.WriteBestBlock(loc);
72 for (
size_t w = 0; w < scripts_watch_only.size(); ++w) {
73 const auto& [
script, dest] = scripts_watch_only.at(w);
80 for (
size_t j = 0; j <
keys.size(); ++j) {
90 mtx.
vout.emplace_back(
COIN, scripts_watch_only.at(j % NUM_WATCH_ONLY_ADDR).first);
100 assert(res->watchonly_wallet);
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
static constexpr CAmount COIN
The amount of satoshis in one BTC.
#define Assert(val)
Identity function.
An encapsulated private key.
CPrivKey GetPrivKey() const
Convert the private key to a CPrivKey (serialized OpenSSL private key data).
CPubKey GetPubKey() const
Compute the public key from a private key.
An encapsulated public key.
Main entry point to nanobench's benchmarking facility.
Bench & epochs(size_t numEpochs) noexcept
Controls number of epochs, the number of measurements to perform.
detail::SetupRunner< SetupOp > setup(SetupOp setupOp)
Configure an untimed setup step per epoch (forces single-iteration epochs).
bool LoadKey(const CKey &key, const CPubKey &pubkey)
Adds a key to the store, without saving it to disk (used by LoadWallet)
bool LoadWatchOnly(const CScript &dest)
Adds a watch-only address to the store, without saving it to disk (used by LoadWallet)
Access to the wallet database.
CKey GenerateRandomKey(bool compressed) noexcept
std::unique_ptr< WalletLoader > MakeWalletLoader(Chain &chain, ArgsManager &args)
Return implementation of ChainClient interface for a wallet loader.
std::unique_ptr< WalletDatabase > CreateMockableWalletDatabase()
util::Result< MigrationResult > MigrateLegacyToDescriptor(const std::string &wallet_name, const SecureString &passphrase, WalletContext &context, bool load_wallet)
Do all steps to migrate a legacy wallet to a descriptor wallet.
static void WalletMigration(benchmark::Bench &bench)
static CTransactionRef MakeTransactionRef(Tx &&txIn)
static RPCMethod generate()
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
A mutable version of CTransaction.
std::vector< CTxOut > vout
State of transaction not confirmed or conflicting with a known block and not in the mempool.
std::vector< uint16_t > keys