What changed, and why it matters
This commit only changes comments and the order of two lines in a test file. It does not alter any actual code behavior, security logic, or production functionality. It is a code-review cleanup suggestion applied to a unit test.
No security action needed. This is a non-functional test-file comment/ordering cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff in tests/test_psbt_parser.py rewrites explanatory comments and swaps the order of setting foreign_input.witness_utxo.script_pubkey and foreign_input.non_witness_utxo = None. The final state of the test object is identical: both assignments still occur before psbt.inputs.append(foreign_input). No executable semantics changed.
Changed components
tests/test_psbt_parser.pyInspect captured patch +13 / −8
### tests/test_psbt_parser.py
@@ -1314,14 +1314,19 @@ def test__parse__verified_derivation_paths_none_for_not_owned_input(self):
"""
psbt = self._psbt_with_change()
- # The other party's input: their utxo, carrying no derivation info. Witness-only,
- # as a real payjoin counterparty's input is — the deepcopy's non_witness_utxo
- # describes this seed's coin and would contradict the witness_utxo rewritten below.
- foreign_input = deepcopy(psbt.inputs[0])
- foreign_input.bip32_derivations.clear()
- foreign_input.non_witness_utxo = None
- foreign_input.witness_utxo.script_pubkey = script.p2wpkh(foreign_public_key())
- psbt.inputs.append(foreign_input)
+# Build the other party's input, starting from a copy of our input:
+foreign_input = deepcopy(psbt.inputs[0])
+
+# A payjoin counterparty's input would not have derivation path info
+foreign_input.bip32_derivations.clear()
+
+# Alter the input so it's owned by the other party
+foreign_input.witness_utxo.script_pubkey = script.p2wpkh(foreign_public_key())
+
+# We can't let this copy's original non_witness_utxo contradict the witness_utxo we just altered.
+foreign_input.non_witness_utxo = None
+
+psbt.inputs.append(foreign_input)
# The payjoin shape
psbt_parser = self._parse(psbt)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.