Skip to content

Commit b34e19a

Browse files
committed
Merge bitcoin/bitcoin#27665: walletdb: Remove unused CreateMockWalletDatabase
0282b21 walletdb: Remove unused CreateMockWalletDatabase (Andrew Chow) Pull request description: This has been superseded by the MockableDatabase. Remove to avoid confusion as to which type of mock database to use for testing. I thought this was included in #26715, maybe it got lost in a rebase. ACKs for top commit: furszy: utACK 0282b21 brunoerg: crACK 0282b21 Tree-SHA512: 18445c4d8a4e2609ef7471c6d75297f43694b79e768f6c993a5addb1dc0e88bd12bac263c9d8e903d828ddf6bf50434f9e2f72048f4fc528e98fed8ee65123ca
2 parents d7700d3 + 0282b21 commit b34e19a

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)