mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-30 10:42:23 +02:00
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:
@ -229,14 +229,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
# So set it to None to force -disablewallet, because the wallet is not needed.
|
||||
self.options.descriptors = None
|
||||
elif self.options.descriptors is None:
|
||||
# Some wallet is either required or optionally used by the test.
|
||||
# Prefer SQLite unless it isn't available
|
||||
if self.is_sqlite_compiled():
|
||||
if self.is_wallet_compiled():
|
||||
self.options.descriptors = True
|
||||
elif self.is_bdb_compiled():
|
||||
self.options.descriptors = False
|
||||
else:
|
||||
# If neither are compiled, tests requiring a wallet will be skipped and the value of self.options.descriptors won't matter
|
||||
# Tests requiring a wallet will be skipped and the value of self.options.descriptors won't matter
|
||||
# It still needs to exist and be None in order for tests to work however.
|
||||
# So set it to None, which will also set -disablewallet.
|
||||
self.options.descriptors = None
|
||||
@ -966,16 +962,9 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
self._requires_wallet = True
|
||||
if not self.is_wallet_compiled():
|
||||
raise SkipTest("wallet has not been compiled.")
|
||||
if self.options.descriptors:
|
||||
self.skip_if_no_sqlite()
|
||||
else:
|
||||
if not self.options.descriptors:
|
||||
self.skip_if_no_bdb()
|
||||
|
||||
def skip_if_no_sqlite(self):
|
||||
"""Skip the running test if sqlite has not been compiled."""
|
||||
if not self.is_sqlite_compiled():
|
||||
raise SkipTest("sqlite has not been compiled.")
|
||||
|
||||
def skip_if_no_bdb(self):
|
||||
"""Skip the running test if BDB has not been compiled."""
|
||||
if not self.is_bdb_compiled():
|
||||
@ -1030,7 +1019,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
"""Checks whether wallet support for the specified type
|
||||
(legacy or descriptor wallet) was compiled."""
|
||||
if self.options.descriptors:
|
||||
return self.is_sqlite_compiled()
|
||||
return self.is_wallet_compiled()
|
||||
else:
|
||||
return self.is_bdb_compiled()
|
||||
|
||||
@ -1050,10 +1039,6 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
"""Checks whether the USDT tracepoints were compiled."""
|
||||
return self.config["components"].getboolean("ENABLE_USDT_TRACEPOINTS")
|
||||
|
||||
def is_sqlite_compiled(self):
|
||||
"""Checks whether the wallet module was compiled with Sqlite support."""
|
||||
return self.config["components"].getboolean("USE_SQLITE")
|
||||
|
||||
def is_bdb_compiled(self):
|
||||
"""Checks whether the wallet module was compiled with BDB support."""
|
||||
return self.config["components"].getboolean("USE_BDB")
|
||||
|
Reference in New Issue
Block a user