tests: don't fail tx extraction if not all inputs are finalized
What changed, and why it matters
This change only modifies a test file. It adjusts how a test extracts transaction data from a partially signed Bitcoin transaction (PSBT) so that tests for multisig or partial-swap transactions don't fail when not every input is fully signed. There is no change to production code, wallet logic, or security behavior.
No security action required. Review as normal test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In test_jade.py’s test_sign_psbt helper, the PSBT extraction flag is changed from WALLY_PSBT_EXTRACT_FINAL to WALLY_PSBT_EXTRACT_OPT_FINAL. The former requires all inputs to be finalized before extraction; the latter allows extraction of finalized inputs even when some inputs remain unfinalized. This is a test-only relaxation to support validating partially signed transactions (e.g., multisig or partial swaps) against expected outputs.
Changed components
test_jade.pytest_sign_psbt test helperInspect captured patch +3 / −1
diff --git a/test_jade.py b/test_jade.py
index 660613f..45c83c4 100644
--- a/test_jade.py
+++ b/test_jade.py
@@ -3044,7 +3044,9 @@ def test_sign_psbt(jadeapi, cases):
if expected_txn:
psbt = wally.psbt_from_bytes(rslt, 0)
wally.psbt_finalize(psbt, 0)
- txn = wally.psbt_extract(psbt, wally.WALLY_PSBT_EXTRACT_FINAL)
+ # Extract finalized inputs where possible (e.g. multisigs may
+ # not be fully signed and thus aren't finalizable)
+ txn = wally.psbt_extract(psbt, wally.WALLY_PSBT_EXTRACT_OPT_FINAL)
txn = wally.tx_to_bytes(txn, wally.WALLY_TX_FLAG_USE_WITNESS)
assert txn == expected_txn, txn.hex()
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.