test: add BIP352 scanning to the functional test framework

bitcoin/bitcoin: PR #36835

1 suggestion

Earlier concerns neither republished nor resolved: 1 minor finding. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · Witness-version skip rule lacks Python coverage

The Python receiving vectors contain no witness-version-2-or-higher prevouts, so removing the transaction-wide skip guard from scan() would leave the existing assertions unchanged.

Location: test/functional/test_framework/bip352.py:60 (head).

Details and suggested fix

Add a focused test using the "Simple send: two inputs" receiving vector. First assert that scanning its original inputs finds the expected output. Then append an input whose prevout is OP_2 followed by a 32-byte push and whose outpoint serializes after the existing smallest outpoint, and assert that scan() returns []. Without the guard, get_input_pubkey() would ignore the new input, leaving the key sum and input hash unchanged and still finding the original output. This isolates the transaction-wide skip rule rather than allowing a changed input hash to make the negative assertion pass accidentally. The C++ test bip352_skips_transactions_spending_unknown_segwit_versions already checks the analogous distinction.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.