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 PR adds tests to check CHECKSEQUENCEVERIFY functionality using the time parameter as well as the height parameter. I'm also not entirely sure the existing tests were totally right. They had CSV OP codes in the outputs of the spending transaction, which is unnecessary, and the
fail csv with bad sequence
test wasn't actually spending from a CSV output.I wrote this PR mainly as an exploration of CSV for a cross-chain atomic swap module. The utility function
CSVencode
is necessary to check against time instead of block height (see BIP68) and this is the function I really wanted to test -- if you want to use time-based CSV in a transaction you'll need to encode the time this way and I don't think there's currently a method anywhere in the library that does this? So actually it might make more sense to put that method somewhere else, like inchain
,mtx
, orscript
?