build: require sqlite when building the wallet

Require that sqlite is available in order to compile the wallet. Removes
instances of USE_SQLITE since it is no longer possible to not have
sqlite available.

The NO_SQLITE option is dropped from depends.

Co-authored-by: Ava Chow <github@achow101.com>
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
This commit is contained in:
Sjors Provoost
2025-03-12 15:42:38 +01:00
parent 502d47203e
commit 36b6f36ac4
40 changed files with 33 additions and 142 deletions

View File

@@ -13,9 +13,7 @@
#ifdef USE_BDB
#include <wallet/bdb.h>
#endif
#ifdef USE_SQLITE
#include <wallet/sqlite.h>
#endif
#include <wallet/migrate.h>
#include <wallet/test/util.h>
#include <wallet/walletutil.h> // for WALLET_FLAG_DESCRIPTORS
@@ -138,9 +136,7 @@ static std::vector<std::unique_ptr<WalletDatabase>> TestDatabases(const fs::path
// Needs BDB to make the DB to read
dbs.emplace_back(std::make_unique<BerkeleyRODatabase>(BDBDataFile(path_root / "bdb"), /*open=*/false));
#endif
#ifdef USE_SQLITE
dbs.emplace_back(MakeSQLiteDatabase(path_root / "sqlite", options, status, error));
#endif
dbs.emplace_back(CreateMockableWalletDatabase());
return dbs;
}
@@ -293,8 +289,6 @@ BOOST_AUTO_TEST_CASE(erase_prefix)
}
}
#ifdef USE_SQLITE
// Test-only statement execution error
constexpr int TEST_SQLITE_ERROR = -999;
@@ -385,7 +379,6 @@ BOOST_AUTO_TEST_CASE(concurrent_txn_dont_interfere)
BOOST_CHECK(handler2->Read(key, read_value));
BOOST_CHECK_EQUAL(read_value, value2);
}
#endif // USE_SQLITE
BOOST_AUTO_TEST_SUITE_END()
} // namespace wallet

View File

@@ -8,8 +8,8 @@ target_sources(fuzz
coinselection.cpp
crypter.cpp
fees.cpp
$<$<BOOL:${USE_SQLITE}>:${CMAKE_CURRENT_LIST_DIR}/notifications.cpp>
$<$<BOOL:${USE_SQLITE}>:${CMAKE_CURRENT_LIST_DIR}/scriptpubkeyman.cpp>
notifications.cpp
scriptpubkeyman.cpp
spend.cpp
wallet_bdb_parser.cpp
)

View File

@@ -27,9 +27,7 @@ class WalletDatabase;
struct WalletContext;
static const DatabaseFormat DATABASE_FORMATS[] = {
#ifdef USE_SQLITE
DatabaseFormat::SQLITE,
#endif
#ifdef USE_BDB
DatabaseFormat::BERKELEY,
#endif