What changed, and why it matters
This commit only updates the project's automated test harness to work with newer versions of Bitcoin Core (specifically version 30). It changes how tests detect Bitcoin Core's version, handle removed legacy wallet features, and adjust an expected test result about data size limits. There is no change to the COLDCARD firmware itself or to any code that runs on the device, so this has no security relevance for end users.
No security action needed. Treat as routine test-maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies testing/api.py and testing/test_sign.py. In api.py it records bitcoind.version, updates comments about BDB wallet deprecation/removal, broadens exception-string matching for BDB wallet creation errors, and handles the ‘Method not found’ error from dumpwallet in Core v30. In test_sign.py it gates an 80-byte OP_RETURN policy assertion so it only applies before Bitcoin Core v30, where the policy changed. These are purely test-infrastructure compatibility changes.
Changed components
testing/api.pytesting/test_sign.pyInspect captured patch +11 / −6
diff --git a/testing/api.py b/testing/api.py
index fee2f28..cb7d646 100644
--- a/testing/api.py
+++ b/testing/api.py
@@ -33,6 +33,7 @@ class Bitcoind:
self.userpass = None
self.supply_wallet = None
self.has_bdb = True
+ self.version = None
def start(self):
@@ -51,7 +52,8 @@ class Bitcoind:
[
self.bitcoind_path,
# needed for newest master
- # TODO legacy wallet will be deprecated in 29
+ # legacy wallet was deprecated in v29
+ # and removed completely in v30
"-deprecatedrpc=create_bdb",
"-regtest",
f"-datadir={self.datadir}",
@@ -91,12 +93,14 @@ class Bitcoind:
pass
assert self.rpc.getblockchaininfo()['chain'] == 'regtest'
- assert self.rpc.getnetworkinfo()['version'] >= 220000, "we require >= 22.0 of Core"
+ self.version = self.rpc.getnetworkinfo()['version']
+ assert self.version >= 220000, "we require >= 22.0 of Core"
# not descriptors so that we can do dumpwallet
try:
self.supply_wallet = self.create_wallet(wallet_name="supply", descriptors=False)
except JSONRPCException as e:
- assert "BDB wallet creation is deprecated" in str(e)
+ assert "BDB wallet creation is deprecated" in str(e) \
+ or "no longer possible to create a legacy wallet" in str(e) # before v30.0 vs v30.0+
self.has_bdb = False
self.supply_wallet = self.create_wallet(wallet_name="supply", descriptors=True)
@@ -172,8 +176,9 @@ def match_key(bitcoind, set_master_key, reset_seed_words):
os.unlink(fn)
except JSONRPCException as e:
- print(str(e))
- assert "Only legacy wallets are supported by this command" in str(e)
+ assert "Only legacy wallets are supported by this command" in str(e) \
+ or "Method not found" in str(e) # v30.0
+
prv_descs = bitcoind.supply_wallet.listdescriptors(True) # True --> show private
prv = prv_descs["descriptors"][0]["desc"].replace("pkh(", "").split("/")[0]
diff --git a/testing/test_sign.py b/testing/test_sign.py
index d59ec40..c38b7a1 100644
--- a/testing/test_sign.py
+++ b/testing/test_sign.py
@@ -1863,7 +1863,7 @@ def test_op_return_signing(op_return_data, dev, fake_txn, bitcoind_d_sim_watch,
# tx = cc.finalizepsbt(base64.b64encode(signed).decode())["hex"]
res = cc.testmempoolaccept([tx])[0]
- if len(op_return_data) > 80:
+ if (bitcoind.version < 300000) and (len(op_return_data) > 80):
# policy
assert res["allowed"] is False
assert res["reject-reason"] == "scriptpubkey"
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.