Exercise the cache's read path in the equivalence test
What changed, and why it matters
This commit only changes a test file. It strengthens an existing test so that it actually exercises the read path of a caching mechanism, rather than only the write path. There is no change to production code, no fix for a vulnerability, and no indication of a security issue being patched.
No action needed. This is a benign test-only improvement. Reviewers may optionally verify that the production cache implementation has independent coverage for read-path correctness.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is in tests/test_psbt_parser.py. The test_cache_does_not_change_parse_output test builds a PSBT and appends a duplicate change output so that the second traversal exercises the cache’s read path. Previously, only one change output was appended, meaning every derivation was a cache miss and the test only verified that caching did not change behavior on first access. This is a test-coverage improvement, not a code fix.
Changed components
tests/test_psbt_parser.pyInspect captured patch +5 / −1
### tests/test_psbt_parser.py
@@ -658,9 +658,13 @@ def test_cache_does_not_change_parse_output(self):
each cosigner's account xpub.
"""
def build_psbt(input_base64: str, change_hex: str) -> PSBT:
- # A fresh psbt for each parse: the base psbt plus its change output
+ # A fresh psbt for each parse: the base psbt plus its change output, twice.
psbt = PSBT.parse(a2b_base64(input_base64))
psbt.outputs.append(create_output(change_hex, 10_000))
+
+ # Add a duplicate output to ensure that the cache yields some hits; the second
+ # output will traverse the same levels the first one just cached.
+ psbt.outputs.append(create_output(change_hex, 10_000))
return psbt
def assert_cache_makes_no_difference(input_base64: str, change_hex: str):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.