CLTV: Add more tests to improve coverage#6368
Merged
laanwj merged 1 commit intobitcoin:masterfrom Jul 9, 2015
eordano:test/cltv
Merged
CLTV: Add more tests to improve coverage#6368laanwj merged 1 commit intobitcoin:masterfrom eordano:test/cltv
laanwj merged 1 commit intobitcoin:masterfrom
eordano:test/cltv
Conversation
src/test/data/tx_invalid.json
Outdated
Contributor
There was a problem hiding this comment.
Seems that this test is nearly identical to the one at https://github.com/eordano/bitcoin/blob/test/cltv/src/test/data/tx_invalid.json#L160, other than being in the scriptSig vs. scriptPubKey, and using 1 as the threshold rather than 0. Is that correct, or am I misunderstanding something?
Contributor
|
Thanks for the review! |
Four cases included: * The CLTV operand type mismatches the tx locktime. In the script it is 1 (interpreted as block height), but in the tx is 500000000 (interpreted as date) * The stack is empty when executing OP_CLTV * The tx is final by having only one input with MAX_INT sequence number * The operand for CLTV is negative (after OP_0 OP_1 OP_SUB)
Contributor
|
Looks good now, ACK |
Member
|
ACK |
laanwj
added a commit
that referenced
this pull request
Jul 9, 2015
cb54d17 CLTV: Add more tests to improve coverage (Esteban Ordano)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This should be a pretty straightforward code review, adding a few tests to the script interpreter when CHECKLOCKTIMEVERIFY is enabled.
The test cases improve coverage for these cases:
OP_CLTVOP_0 OP_1 OP_SUB)