5#ifndef BITCOIN_WALLET_TEST_UTIL_H
6#define BITCOIN_WALLET_TEST_UTIL_H
50using MockableData = std::map<SerializeData, SerializeData, std::less<>>;
67 bool Backup(
const std::string& strDest)
const override {
return true; }
69 std::string
Filename()
override {
return "mockable"; }
70 std::vector<fs::path>
Files()
override {
return {}; }
71 std::string
Format()
override {
return "sqlite-mock"; }
72 std::unique_ptr<DatabaseBatch>
MakeBatch()
override {
return std::make_unique<MockableSQLiteBatch>(*
this); }
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
An in-memory indexed chain of blocks.
An encapsulated private key.
Interface giving clients (wallet processes, maybe other analysis tools in the future) ability to acce...
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
A WalletDatabase whose contents and return values can be modified as needed for testing.
std::string Filename() override
Return path to main database file for logs and error messages.
std::vector< fs::path > Files() override
Return paths to all database created files.
bool Backup(const std::string &strDest) const override
Back up the entire database to a file.
std::unique_ptr< DatabaseBatch > MakeBatch() override
Make a SQLiteBatch connected to this database.
std::string Format() override
RAII class that provides access to a WalletDatabase.
SQLiteBatch(SQLiteDatabase &database)
bool WriteKey(DataStream &&key, DataStream &&value, bool overwrite=true) override
An instance of this class represents one SQLite3 database.
An instance of this class represents one database.
wallet::DescriptorScriptPubKeyMan * CreateDescriptor(CWallet &keystore, const std::string &desc_str, const bool success)
std::unique_ptr< WalletDatabase > CreateMockableWalletDatabase()
const std::string ADDRESS_BCRT1_UNSPENDABLE
static const DatabaseFormat DATABASE_FORMATS[]
MockableSQLiteDatabase & GetMockableDatabase(CWallet &wallet)
std::unique_ptr< CWallet > CreateSyncedWallet(interfaces::Chain &chain, CChain &cchain, const CKey &key)
void TestUnloadWallet(std::shared_ptr< CWallet > &&wallet)
std::unique_ptr< WalletDatabase > DuplicateMockDatabase(WalletDatabase &database)
std::shared_ptr< CWallet > TestLoadWallet(std::unique_ptr< WalletDatabase > database, WalletContext &context)
std::shared_ptr< CWallet > TestCreateWallet(std::unique_ptr< WalletDatabase > database, WalletContext &context, uint64_t create_flags)
std::map< SerializeData, SerializeData, std::less<> > MockableData
RPCMethod getnewaddress()
CTxDestination getNewDestination(CWallet &w, OutputType output_type)
Returns a new destination, of an specific type, from the wallet.
WalletContext struct containing references to state shared between CWallet instances,...