aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/test/util.h
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2023-05-25 14:06:21 -0400
committerAndrew Chow <github@achow101.com>2023-05-25 14:40:26 -0400
commitc61d3f02f5122b38ea8bf0029aa9dfbbf38e10d0 (patch)
tree5cf8152ce5f1e625619cdfada6332ad7488a8ad0 /src/wallet/test/util.h
parent25202cace9140870c75cb3a811e10045df88c226 (diff)
downloadbitcoin-c61d3f02f5122b38ea8bf0029aa9dfbbf38e10d0.tar.xz
tests, bench: Consolidate {Test,Bench}Un/LoadWallet helper
The wallet tests and benchmarks both had helper functions for loading and unloading the wallet for the test that were almost identical. These functions are consolidated and reused.
Diffstat (limited to 'src/wallet/test/util.h')
-rw-r--r--src/wallet/test/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/test/util.h b/src/wallet/test/util.h
index eb1cfd9e21..fc9448632d 100644
--- a/src/wallet/test/util.h
+++ b/src/wallet/test/util.h
@@ -21,6 +21,7 @@ class Chain;
namespace wallet {
class CWallet;
class WalletDatabase;
+struct WalletContext;
static const DatabaseFormat DATABASE_FORMATS[] = {
#ifdef USE_SQLITE
@@ -33,6 +34,10 @@ static const DatabaseFormat DATABASE_FORMATS[] = {
std::unique_ptr<CWallet> CreateSyncedWallet(interfaces::Chain& chain, CChain& cchain, const CKey& key);
+std::shared_ptr<CWallet> TestLoadWallet(WalletContext& context);
+std::shared_ptr<CWallet> TestLoadWallet(std::unique_ptr<WalletDatabase> database, WalletContext& context, uint64_t create_flags);
+void TestUnloadWallet(std::shared_ptr<CWallet>&& wallet);
+
// Creates a copy of the provided database
std::unique_ptr<WalletDatabase> DuplicateMockDatabase(WalletDatabase& database);