test: Expand script verification tests to cover all output types and flags#137
Open
stringintech wants to merge 1 commit intosedited:masterfrom
Open
test: Expand script verification tests to cover all output types and flags#137stringintech wants to merge 1 commit intosedited:masterfrom
stringintech wants to merge 1 commit intosedited:masterfrom
Conversation
…flags New output types covered: P2SH-multisig, CLTV, CSV, P2WPKH, P2WSH, P2TR script-path. New flags covered: VERIFY_NONE, VERIFY_P2SH, VERIFY_DERSIG, VERIFY_NULLDUMMY, VERIFY_CHECKLOCKTIMEVERIFY, VERIFY_CHECKSEQUENCEVERIFY. Split script_verify_test into per-output-type tests. Each test checks validity with and without its relevant flag.
46d18e1 to
3cac307
Compare
Contributor
|
Can we reuse these tests in the other libraries? |
Author
Yes, my main motivation was to be able to extend the tests in kernel-bindings-tests, and I'm planning to open a PR there as well soon! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #132.
Summary
VERIFY_NONE,VERIFY_P2SH,VERIFY_DERSIG,VERIFY_NULLDUMMY,VERIFY_CHECKLOCKTIMEVERIFY,VERIFY_CHECKSEQUENCEVERIFYscript_verify_testinto separate tests for each output typeApproach
Subtests are ordered from oldest output types to newest. Each test follows the same pattern:
For CLTV and CSV, changing locktime/sequence requires a fresh signature, so the invalid case uses a re-signed transaction rather than a byte flip. Unlike the other tests which use real mainnet transactions, the CLTV and CSV test data was created on regtest using a functional test.