diff --git a/tests/test_psbt_parser.py b/tests/test_psbt_parser.py index 1f4c44a9..71d38925 100644 --- a/tests/test_psbt_parser.py +++ b/tests/test_psbt_parser.py @@ -658,9 +658,13 @@ class TestPSBTParserOptimizations: 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):