Refactor and expand script verification tests#13
Conversation
|
Tested pre-release |
janb84
left a comment
There was a problem hiding this comment.
ACK 66e1f3c
This was straightforward to implement and the extension of the test is welcome :)
2 suggestions:
(not related to the current changes) In the makefile L21, add build so that for a test no separate build command has to be given but only a make test will suffice :
Details
From:
go build -o $(MOCK_HANDLER_BIN) ./cmd/mock-handler
test:
@echo "Running runner unit tests..."To
go build -o $(MOCK_HANDLER_BIN) ./cmd/mock-handler
test: build
@echo "Running runner unit tests..."other nit see comment
|
Echo'ing what janb84 said, this was very straightforward to implement, updated stickies-v/py-bitcoinkernel#42 to |
|
Thanks a lot for looking into this. I’m sorry that I may not be able to address your comments soon enough - I have been experiencing very limited internet access for the past few weeks. |
Refactor script verification tests to use stateful object references (transaction, script pubkey, transaction output, precomputed tx data) instead of inline hex params. Expand coverage from a single file to 11 dedicated files, one per output type (P2PKH, P2SH multisig, CLTV, CSV, P2SH-P2WPKH, P2SH-P2WSH, P2WPKH, P2WSH, P2TR keypath, P2TR scriptpath), each testing valid, corrupted, and flag-sensitivity variants. Adapt dependency tracker to detect refs nested inside array-valued params. Document the new/changed methods in handler-spec.md.
66e1f3c to
a77e99c
Compare
Summary
Refactors script verification tests to use stateful object references (transaction, script pubkey, transaction output, precomputed tx data) instead of inline hex params.
Expands coverage from a single file to 11 dedicated files, one per output type (P2PKH, P2SH multisig, CLTV, CSV, P2SH-P2WPKH, P2SH-P2WSH, P2WPKH, P2WSH, P2TR keypath, P2TR scriptpath), each testing valid, corrupted, and flag-sensitivity variants (based on how I expanded the tests in sedited/rust-bitcoinkernel#137).
Adapts the dependency tracker to detect refs nested inside array-valued params, and documents the new/changed methods in
handler-spec.md.