Skip to content

Commit

Permalink
Merge #24309: test: test that OP_1-OP_16 (but not lower/higher) start…
Browse files Browse the repository at this point in the history
… witness programs

34d0e07 Test that OP_1-OP_16 (but not lower/higher) start witness programs (Pieter Wuille)

Pull request description:

  Cherry-picks one of the commits adding test coverage from #13062. As [pointed out by aj](https://github.com/bitcoin/bitcoin/pull/13062/files#r492723037):
  > could move the test additions to the first commit, since they're testing things that are already true

  Pull the additional test code into master earlier.

ACKs for top commit:
  laanwj:
    Code review ACK 34d0e07

Tree-SHA512: ff0ab2a54613ea6e8246b443363b362dd41b5e464faba4d11be6003aa6588a626cf56e142a3b94465cd37dd3ac4debea08455db96bade336171b6c30ea894950
  • Loading branch information
fanquake committed Feb 14, 2022
2 parents af0b578 + 34d0e07 commit 3ce40e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/data/script_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,10 @@
[["51", 0.00000000 ], "", "0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d", "P2SH,WITNESS", "WITNESS_PROGRAM_MISMATCH", "Witness script hash mismatch"],
[["00", 0.00000000 ], "", "0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d", "", "OK", "Invalid witness script without WITNESS"],
[["51", 0.00000000 ], "", "0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d", "", "OK", "Witness script hash mismatch without WITNESS"],
[["51", 0.00000000 ], "", "-1 0x021234", "P2SH,WITNESS", "WITNESS_UNEXPECTED", "OP_1NEGATE does not introduce a witness program"],
[["51", 0.00000000 ], "00", "1 0x021234", "P2SH,WITNESS", "WITNESS_MALLEATED", "OP_1 does introduce a witness program"],
[["51", 0.00000000 ], "00", "16 0x021234", "P2SH,WITNESS", "WITNESS_MALLEATED", "OP_16 does introduce a witness program"],
[["51", 0.00000000 ], "", "NOP 0x021234", "P2SH,WITNESS", "WITNESS_UNEXPECTED", "NOP does not introduce a witness program"],

["Automatically generated test cases"],
[
Expand Down

0 comments on commit 3ce40e6

Please sign in to comment.