What changed, and why it matters
This commit only rewrites a comment in a test file. It does not change any actual code behavior, security checks, or user-facing functionality. The new comment explains why a test expects an error when a legacy Bitcoin transaction input only provides a witness UTXO. There is no security fix or vulnerability introduced here.
No action required. This is a documentation-only change in test code. Continue normal review processes.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies only a docstring/comment in tests/test_psbt_parser.py for test_legacy_input_without_non_witness_utxo_raises. The original comment described a fund-loss scenario via inflated witness_utxo and miner fee. The replacement frames the refusal as a BIP-174 compliance and verification issue (witness_utxo reserved for segwit inputs; without non_witness_utxo the input amount and displayed fee cannot be verified). No executable code, assertions, or PSBT parsing logic were changed.
Changed components
tests/test_psbt_parser.pyInspect captured patch +5 / −3
### tests/test_psbt_parser.py
@@ -589,9 +589,11 @@ def test_witness_utxo_script_pubkey_disagreeing_with_non_witness_utxo_raises(sel
@pytest.mark.parametrize("psbt_base64", LEGACY_INPUTS)
def test_legacy_input_without_non_witness_utxo_raises(self, psbt_base64: str):
"""
- The concrete fund-loss case: a legacy sighash commits no input amount, so an inflated
- witness_utxo yields a *valid* signature on a transaction that burns the difference as
- miner fee. With no non_witness_utxo to check against, we have to refuse.
+ BIP-174 reserves witness_utxo for segwit inputs, so for a legacy input, a
+ well-formed psbt would only provide its non_witness_utxo. In this test we create
+ an unusual psbt that presents a legacy input and only a witness_utxo. In this case
+ we can't verify the input's amount or the fee we would display. The parse should
+ raise PSBTInputAmountVerificationError.
"""
psbt = self.build_psbt(psbt_base64)
inp = psbt.inputs[0]Why this scored 12/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.