Merge bitcoin/bitcoin#27665: walletdb: Remove unused CreateMockWalletDatabase

0282b2126d 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 0282b212
  brunoerg:
    crACK 0282b2126d

Tree-SHA512: 18445c4d8a4e2609ef7471c6d75297f43694b79e768f6c993a5addb1dc0e88bd12bac263c9d8e903d828ddf6bf50434f9e2f72048f4fc528e98fed8ee65123ca
This commit is contained in:
fanquake 2023-05-16 09:45:24 +01:00
commit b34e19a2bf
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
2 changed files with 0 additions and 38 deletions

View file

@ -1262,38 +1262,4 @@ std::unique_ptr<WalletDatabase> MakeDatabase(const fs::path& path, const Databas
status = DatabaseStatus::FAILED_BAD_FORMAT;
return nullptr;
}
/** Return object for accessing temporary in-memory database. */
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase(DatabaseOptions& options)
{
std::optional<DatabaseFormat> format;
if (options.require_format) format = options.require_format;
if (!format) {
#ifdef USE_BDB
format = DatabaseFormat::BERKELEY;
#endif
#ifdef USE_SQLITE
format = DatabaseFormat::SQLITE;
#endif
}
if (format == DatabaseFormat::SQLITE) {
#ifdef USE_SQLITE
return std::make_unique<SQLiteDatabase>(":memory:", "", options, true);
#endif
assert(false);
}
#ifdef USE_BDB
return std::make_unique<BerkeleyDatabase>(std::make_shared<BerkeleyEnvironment>(), "", options);
#endif
assert(false);
}
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase()
{
DatabaseOptions options;
return CreateMockWalletDatabase(options);
}
} // namespace wallet

View file

@ -305,10 +305,6 @@ using KeyFilterFn = std::function<bool(const std::string&)>;
//! Unserialize a given Key-Value pair and load it into the wallet
bool ReadKeyValue(CWallet* pwallet, DataStream& ssKey, CDataStream& ssValue, std::string& strType, std::string& strErr, const KeyFilterFn& filter_fn = nullptr);
/** Return object for accessing temporary in-memory database. */
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase(DatabaseOptions& options);
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase();
} // namespace wallet
#endif // BITCOIN_WALLET_WALLETDB_H