mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-09 20:23:35 +01:00
Merge bitcoin/bitcoin#31961: Require sqlite when building the wallet
36b6f36ac4build: require sqlite when building the wallet (Sjors Provoost) Pull request description: 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. This is another step towards dropping the legacy wallet, extracted from #31250. ACKs for top commit: m3dwards: ACK36b6f36ac4davidgumberg: crACK36b6f36ac4hebasto: re-ACK36b6f36ac4. Tree-SHA512: 870a0135671c80c4f28602119eb8637a1ed43b51b1673bfe88425782fb62ec6ef0f3d6baf0d5984d6a243779b0f63423fd4c4dc324ef87bffba13d63e05ad793
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