Skip to content

Improve RecoveryId conversion functions #800

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

Merged
merged 2 commits into from
Jun 13, 2025

Conversation

tcharding
Copy link
Member

Add the to_u8 getter discussed in issue #774 and then make the From impl be on u8.

Close: #774

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`
@tcharding
Copy link
Member Author

If this goes in the #765 is redundant and can be closed.

@tcharding tcharding force-pushed the 06-12-recovery-id-getters branch from 8ef905d to 319fa08 Compare June 12, 2025 03:33
@apoelstra
Copy link
Member

In this crate you have to run the nightly formatter to get past CI.

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`.
@tcharding tcharding force-pushed the 06-12-recovery-id-getters branch from 319fa08 to fed623e Compare June 12, 2025 19:48
@tcharding
Copy link
Member Author

Done, no other changes.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fed623e; successfully ran local tests

@apoelstra apoelstra merged commit b26515c into rust-bitcoin:master Jun 13, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add RecoveryId getters
2 participants