Skip to content

Commit 0282b21

Browse files
committed
walletdb: Remove unused CreateMockWalletDatabase
This has been superseded by the MockableDatabase. Remove to avoid confusion as to which type of mock database to use for testing.
1 parent d7700d3 commit 0282b21

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

src/wallet/walletdb.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,38 +1262,4 @@ std::unique_ptr<WalletDatabase> MakeDatabase(const fs::path& path, const Databas
12621262
status = DatabaseStatus::FAILED_BAD_FORMAT;
12631263
return nullptr;
12641264
}
1265-
1266-
/** Return object for accessing temporary in-memory database. */
1267-
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase(DatabaseOptions& options)
1268-
{
1269-
1270-
std::optional<DatabaseFormat> format;
1271-
if (options.require_format) format = options.require_format;
1272-
if (!format) {
1273-
#ifdef USE_BDB
1274-
format = DatabaseFormat::BERKELEY;
1275-
#endif
1276-
#ifdef USE_SQLITE
1277-
format = DatabaseFormat::SQLITE;
1278-
#endif
1279-
}
1280-
1281-
if (format == DatabaseFormat::SQLITE) {
1282-
#ifdef USE_SQLITE
1283-
return std::make_unique<SQLiteDatabase>(":memory:", "", options, true);
1284-
#endif
1285-
assert(false);
1286-
}
1287-
1288-
#ifdef USE_BDB
1289-
return std::make_unique<BerkeleyDatabase>(std::make_shared<BerkeleyEnvironment>(), "", options);
1290-
#endif
1291-
assert(false);
1292-
}
1293-
1294-
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase()
1295-
{
1296-
DatabaseOptions options;
1297-
return CreateMockWalletDatabase(options);
1298-
}
12991265
} // namespace wallet

src/wallet/walletdb.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,6 @@ using KeyFilterFn = std::function<bool(const std::string&)>;
305305

306306
//! Unserialize a given Key-Value pair and load it into the wallet
307307
bool ReadKeyValue(CWallet* pwallet, DataStream& ssKey, CDataStream& ssValue, std::string& strType, std::string& strErr, const KeyFilterFn& filter_fn = nullptr);
308-
309-
/** Return object for accessing temporary in-memory database. */
310-
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase(DatabaseOptions& options);
311-
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase();
312308
} // namespace wallet
313309

314310
#endif // BITCOIN_WALLET_WALLETDB_H

0 commit comments

Comments
 (0)