Skip to content

Commit 23729db

Browse files
fanquakevijaydasmp
authored andcommitted
Merge 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 bitcoin#26715, maybe it got lost in a rebase. ACKs for top commit: furszy: utACK 0282b21 brunoerg: crACK 0282b21 Tree-SHA512: 18445c4d8a4e2609ef7471c6d75297f43694b79e768f6c993a5addb1dc0e88bd12bac263c9d8e903d828ddf6bf50434f9e2f72048f4fc528e98fed8ee65123ca
1 parent a9026d7 commit 23729db

2 files changed

Lines changed: 0 additions & 37 deletions

File tree

src/wallet/walletdb.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,38 +1254,4 @@ std::unique_ptr<WalletDatabase> CreateDummyWalletDatabase()
12541254
{
12551255
return std::make_unique<DummyDatabase>();
12561256
}
1257-
1258-
/** Return object for accessing temporary in-memory database. */
1259-
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase(DatabaseOptions& options)
1260-
{
1261-
1262-
std::optional<DatabaseFormat> format;
1263-
if (options.require_format) format = options.require_format;
1264-
if (!format) {
1265-
#ifdef USE_BDB
1266-
format = DatabaseFormat::BERKELEY;
1267-
#endif
1268-
#ifdef USE_SQLITE
1269-
format = DatabaseFormat::SQLITE;
1270-
#endif
1271-
}
1272-
1273-
if (format == DatabaseFormat::SQLITE) {
1274-
#ifdef USE_SQLITE
1275-
return std::make_unique<SQLiteDatabase>(":memory:", "", options, true);
1276-
#endif
1277-
assert(false);
1278-
}
1279-
1280-
#ifdef USE_BDB
1281-
return std::make_unique<BerkeleyDatabase>(std::make_shared<BerkeleyEnvironment>(), "", options);
1282-
#endif
1283-
assert(false);
1284-
}
1285-
1286-
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase()
1287-
{
1288-
DatabaseOptions options;
1289-
return CreateMockWalletDatabase(options);
1290-
}
12911257
} // namespace wallet

src/wallet/walletdb.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,6 @@ bool ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, st
267267
/** Return object for accessing dummy database with no read/write capabilities. */
268268
std::unique_ptr<WalletDatabase> CreateDummyWalletDatabase();
269269

270-
/** Return object for accessing temporary in-memory database. */
271-
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase(DatabaseOptions& options);
272-
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase();
273270
} // namespace wallet
274271

275272
#endif // BITCOIN_WALLET_WALLETDB_H

0 commit comments

Comments
 (0)