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] · Python scanning tests miss the transaction-wide witness-v2+ exclusion

Removing the witness-v2+ exclusion from scan() would leave both new unit tests passing; no current callers of bip352.scan_tx were found.

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

Details and suggested fix

test_receiving_vectors scans only label-free vectors, none of which contains a witness-v2+ prevout. Without this guard, get_input_pubkey() would simply ignore such an input rather than exclude the whole transaction. Add a case based on the "Simple send: two inputs" receiving vector, appending an input with an OP_2 32-byte witness program and an outpoint that serializes after the existing smallest outpoint. Assert that the original inputs produce the expected outputs and that the augmented inputs return []. The extra input contributes no public key and leaves the smallest outpoint unchanged, so removing the guard would incorrectly recover the original outputs and fail the new assertion. This covers the same exclusion already tested separately in C++.


Coverage details

Earlier concerns

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