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
Implement ArbitraryOrd for relative::LockTime #2581
Conversation
Pull Request Test Coverage Report for Build 8513797817Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
2f0859c
to
11867db
Compare
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.
ACK 11867db
11867db
to
53c5d4f
Compare
Rebase only, no other changes. |
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.
ACK 53c5d4f
53c5d4f
to
f5841e3
Compare
Forgot to comment yesterday, IIRC I fixed the rustdoc so its the same in both |
The comma after "incommensurate" should be a semicolon. |
You mean you want the sentence changed to this? /// Locktimes may be height- or time-based, and these metrics are incommensurate; there
/// is no total ordering on locktimes. Currently it is: /// Because locktimes may be height- or time-based, and these metrics are incommensurate, there
/// is no total ordering on locktimes (I repeatedly have to look up how to use semi-colons, I did so again last week.) |
Yep, exactly. |
TL;DR As we do for `absolute::LockTime` and for the same reasons; implement `ArbitraryOrd` for `relative::LockTime`. locktimes do not have a semantic ordering if they differ (blocks, time) so we do not derive `Ord` however it is useful for downstream to be able to order structs that contain lock times. This is exactly what the `ArbitraryOrd` trait is for. Update the rustdocs in `relative` and mirror the docs changes in `absolute`. Fix: rust-bitcoin#2566
f5841e3
to
3520f55
Compare
Done! |
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.
ACK 3520f55
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.
ACK 3520f55. ordered
should be added to all features flags doccomment listed inlib.rs
Can do, thanks for the review! |
Add "ordered" to the list of features in the `bitcoin` crate level docs.
Added as a separate patch, will need re-acking now please @sanket1729 |
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.
ACK d91cdd2
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.
ACK d91cdd2
TL;DR As we do for
absolute::LockTime
and for the same reasons; implementArbitraryOrd
forrelative::LockTime
.locktimes do not have a semantic ordering if they differ (blocks, time) so we do not derive
Ord
however it is useful for downstream to be able to order structs that contain lock times. This is exactly what theArbitraryOrd
trait is for.Fix: #2566