test: fix test_generic_multisig_matches_ga_addresses
What changed, and why it matters
This commit only changes a test file. It fixes how a multi-signature wallet test is structured so that wallet registration happens inside the test loop and so that blinding-key and commitment checks run for each wallet separately. There is no change to the actual Jade firmware or wallet code that users rely on.
No security action needed; this is a test-maintenance change. Reviewers may verify CI passes.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies test_jade.py’s test_generic_multisig_matches_ga_addresses. It removes an early return when no test cases exist, moves register_multisig() inside the per-wallet loop, and indents the blinding_key_tests and commitments_tests loops so they execute per-ga_msig rather than only after the outer loop on the last item. This resolves a test-only issue where Liquid wallet registrations could be overwritten by Bitcoin ones and restores the intended inner-loop coverage. No production code is affected.
Changed components
test_jade.pyInspect captured patch +43 / −34
diff --git a/test_jade.py b/test_jade.py
index 19bb8e3..bdad78b 100644
--- a/test_jade.py
+++ b/test_jade.py
@@ -3299,13 +3299,22 @@ def test_generic_multisig_matches_ga_addresses(jadeapi):
# ie. if I use the standard ga receive-address, I get the same result as
# that using 'generic multisig' (as the co-signers are set-up to match green)
matching_ga_msigs = list(_get_test_cases('multisig_reg_*matches_ga_*.json'))
- if not matching_ga_msigs:
- return
for ga_msig in matching_ga_msigs:
inputdata = ga_msig['input']
signers = inputdata['descriptor']['signers']
+ # Register multisig wallet
+ descriptor = inputdata['descriptor']
+ rslt = jadeapi.register_multisig(inputdata['network'],
+ inputdata['multisig_name'],
+ descriptor['variant'],
+ descriptor['sorted'],
+ descriptor['threshold'],
+ descriptor['signers'],
+ master_blinding_key=descriptor.get('master_blinding_key'))
+ assert rslt is True
+
# Check this test looks good - ie. 2of2 or 2of3
assert inputdata['descriptor']['threshold'] == 2
assert len(signers) == 2 or len(signers) == 3
@@ -3337,38 +3346,38 @@ def test_generic_multisig_matches_ga_addresses(jadeapi):
recovery_xpub=recovery_xpub)
assert rslt == addr_test['expected_address']
- # ... and maybe blinding key tests ...
- for blinding_test in ga_msig.get('blinding_key_tests', []):
- rslt = jadeapi.get_blinding_key(blinding_test['script'])
- assert rslt == blinding_test['expected_blinding_key']
-
- rslt = jadeapi.get_shared_nonce(blinding_test['script'],
- blinding_test['their_pubkey'])
- assert rslt == blinding_test['expected_shared_nonce']
-
- rslt = jadeapi.get_shared_nonce(blinding_test['script'],
- blinding_test['their_pubkey'],
- include_pubkey=True)
- assert rslt['blinding_key'] == blinding_test['expected_blinding_key']
- assert rslt['shared_nonce'] == blinding_test['expected_shared_nonce']
-
- # ... and blinding/commitments tests!
- for blinding_test in ga_msig.get('commitments_tests', []):
- for bf_type, rslt_key in [('ASSET', 'abf'), ('VALUE', 'vbf')]:
- rslt = jadeapi.get_blinding_factor(blinding_test['hash_prevouts'],
- blinding_test['output_index'],
- bf_type)
- assert rslt == blinding_test[rslt_key]
-
- rslt = jadeapi.get_commitments(blinding_test['asset_id'],
- blinding_test['value'],
- blinding_test['hash_prevouts'],
- blinding_test['output_index'],
- multisig_name=inputdata['multisig_name'])
- assert rslt['abf'] == blinding_test['abf']
- assert rslt['vbf'] == blinding_test['vbf']
- assert rslt['asset_generator'] == blinding_test['asset_generator']
- assert rslt['value_commitment'] == blinding_test['value_commitment']
+ # ... and maybe blinding key tests ...
+ for blinding_test in ga_msig.get('blinding_key_tests', []):
+ rslt = jadeapi.get_blinding_key(blinding_test['script'])
+ assert rslt == blinding_test['expected_blinding_key']
+
+ rslt = jadeapi.get_shared_nonce(blinding_test['script'],
+ blinding_test['their_pubkey'])
+ assert rslt == blinding_test['expected_shared_nonce']
+
+ rslt = jadeapi.get_shared_nonce(blinding_test['script'],
+ blinding_test['their_pubkey'],
+ include_pubkey=True)
+ assert rslt['blinding_key'] == blinding_test['expected_blinding_key']
+ assert rslt['shared_nonce'] == blinding_test['expected_shared_nonce']
+
+ # ... and blinding/commitments tests!
+ for blinding_test in ga_msig.get('commitments_tests', []):
+ for bf_type, rslt_key in [('ASSET', 'abf'), ('VALUE', 'vbf')]:
+ rslt = jadeapi.get_blinding_factor(blinding_test['hash_prevouts'],
+ blinding_test['output_index'],
+ bf_type)
+ assert rslt == blinding_test[rslt_key]
+
+ rslt = jadeapi.get_commitments(blinding_test['asset_id'],
+ blinding_test['value'],
+ blinding_test['hash_prevouts'],
+ blinding_test['output_index'],
+ multisig_name=inputdata['multisig_name'])
+ assert rslt['abf'] == blinding_test['abf']
+ assert rslt['vbf'] == blinding_test['vbf']
+ assert rslt['asset_generator'] == blinding_test['asset_generator']
+ assert rslt['value_commitment'] == blinding_test['value_commitment']
def test_generic_multisig_matches_ga_signatures(jadeapi):
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.