Skip to content

bip360: keep test vector checks active under python -O - #2390

Open
wijehyeon wants to merge 1 commit into
bitcoin:masterfrom
wijehyeon:codex/bip360-vector-checks-optimized
Open

wijehyeon wants to merge 1 commit into
bitcoin:masterfrom
wijehyeon:codex/bip360-vector-checks-optimized

Conversation

@wijehyeon

Copy link
Copy Markdown

Follow-up to #2380.

Python removes assert statements under -O, so p2mr.py can report a mismatched test vector as passing. Replace the assertions in run_single_test() with explicit checks that preserve the existing failure messages and exit status.

Testing

On Python 3.12.3, both python3 -m p2mr and python3 -O -m p2mr passed all 9 construction vectors and 7 PQC construction vectors and exited with status 0.

With one expected Merkle root changed in a temporary copy of the vectors, both commands reported the mismatch and exited with status 1. Before this change, the optimized run reported all vectors as passing and exited with status 0.

@jonatack jonatack added Fixups Minor fixups not worth bothering the BIP author(s) for Tests labels Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fixups Minor fixups not worth bothering the BIP author(s) for Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants