-
Notifications
You must be signed in to change notification settings - Fork 305
Make RecoveryId an enum
#743
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
Conversation
b3a9908 to
f6a76af
Compare
|
In f6a76af: There is an |
f6a76af to
d3e5ceb
Compare
|
Good catch @apoelstra, fixed it |
d3e5ceb to
fa0c086
Compare
|
Force pushed a lint fix |
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 fa0c086 successfully ran local tests
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 fa0c086
The `RecoveryId` is an enum but is typically serialized as an integer. We used to provide a `to_i32` function before rust-bitcoin#743. Add a `to_u8` getter to the `RecoveryId`
The `i32` is a hangover from before rust-bitcoin#743, now we have a nice enum and a `from_u8_masked` constructor (along with a `to_u8` getter) lets make the `From<RecoveryId>` impl be on `u8` instead of on `i32`.
The `i32` is a hangover from before rust-bitcoin#743, now we have a nice enum and a `from_u8_masked` constructor (along with a `to_u8` getter) lets make the `From<RecoveryId>` impl be on `u8` instead of on `i32`.
The `i32` is a hangover from before rust-bitcoin#743, now we have a nice enum and a `from_u8_masked` constructor (along with a `to_u8` getter) lets make the `From<RecoveryId>` impl be on `u8` instead of on `i32`.
fa0c086431c9fc6ee872d6a14feccee6eb73dfb5 refactor: recoveryid into enum (Liam Aharon)
Pull request description:
Closes #727
- Refactors `RecoveryId` into an enum.
- Replaces custom type methods `from_i32` and `to_i32` with `TryFrom<i32>` and `Into<i32>` (via `From<RecoveryId> for i32`) implementations.
- Removes derive `Ord` `PartialOrd` and `Hash`, they don't appear to be used. I can implement on the enum if we want to keep them.
ACKs for top commit:
apoelstra:
ACK fa0c086431c9fc6ee872d6a14feccee6eb73dfb5 successfully ran local tests
tcharding:
ACK fa0c086431c9fc6ee872d6a14feccee6eb73dfb5
Tree-SHA512: 2b4f448c69d51ca8bf66110a46aa3a846cc47dc137b67f04643ae01a181f7208508c6af27429e26b3ee5d625c37923adc7fd20ccca701b5f5433b5a62d41a802
fa0c086431c9fc6ee872d6a14feccee6eb73dfb5 refactor: recoveryid into enum (Liam Aharon)
Pull request description:
Closes #727
- Refactors `RecoveryId` into an enum.
- Replaces custom type methods `from_i32` and `to_i32` with `TryFrom<i32>` and `Into<i32>` (via `From<RecoveryId> for i32`) implementations.
- Removes derive `Ord` `PartialOrd` and `Hash`, they don't appear to be used. I can implement on the enum if we want to keep them.
ACKs for top commit:
apoelstra:
ACK fa0c086431c9fc6ee872d6a14feccee6eb73dfb5 successfully ran local tests
tcharding:
ACK fa0c086431c9fc6ee872d6a14feccee6eb73dfb5
Tree-SHA512: 2b4f448c69d51ca8bf66110a46aa3a846cc47dc137b67f04643ae01a181f7208508c6af27429e26b3ee5d625c37923adc7fd20ccca701b5f5433b5a62d41a802
Closes #727
RecoveryIdinto an enum.from_i32andto_i32withTryFrom<i32>andInto<i32>(viaFrom<RecoveryId> for i32) implementations.OrdPartialOrdandHash, they don't appear to be used. I can implement on the enum if we want to keep them.