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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve relative locktime API #2549
improve relative locktime API #2549
Changes from all commits
2ff5085
f02b1da
f27e675
ac968e0
5c8fb5c
0ed2691
319e102
c2f87c7
878b865
04715e3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, there was
From<u16>
, well, I don't really like that...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this type is basically only used within the
LockTime::Height
enum variant, where it is very clear what a bare number is supposed to mean, I think it's fine. Same withTime
, though the interpretation of the number as "512-second intervals" is maybe surprising.But sure, I can drop the
From
impls in a new commit if they bother you. They are not very discoverable and gain little ergonomics over just usingLockTime::from_height
/from_time
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, this looks like a foot gun. Is it really needed? Just decoding
Sequence
and converting that is less error-prone and more explicit.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I considered this. I could go either way on it. I'm not sure that making users go through
Sequence
makes this flow any less footgunny.But I can remove this if you feel strongly about it.
I'd maybe like to add a method to script to encode a
Sequence
number directly into script, if there isn't one, so that users would never need au32
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a leaf error type so we should probably provide a getter if I remembered correctly and that is the policy we settled upon.