Skip to content

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
chain-forgexcr45 added a commit to chain-forgexcr45/rust-secp256k1 that referenced this pull request Sep 28, 2025
…n functions

fed623ef9803fe28f44e7cd331e25b9149a1154b Implement From on u8 for RecoveryId instead of i32 (Tobin C. Harding)
9b4fa8bdc05ef20f4fadd7f1fb73a51cb41d1854 Add RecoveryId getter (Tobin C. Harding)

Pull request description:

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

  Close: #774

ACKs for top commit:
  apoelstra:
    ACK fed623ef9803fe28f44e7cd331e25b9149a1154b; successfully ran local tests

Tree-SHA512: 5a341cbc78d53474a8ffa8fd7fa20796da28e67d226f0298873cd22bfa137d29642b22cabcac1bc8dcd03e6547ae5272990b315dd5808d7e5c775990705cd193
william2332-limf added a commit to william2332-limf/rust-secp256k1 that referenced this pull request Oct 2, 2025
…n functions

fed623ef9803fe28f44e7cd331e25b9149a1154b Implement From on u8 for RecoveryId instead of i32 (Tobin C. Harding)
9b4fa8bdc05ef20f4fadd7f1fb73a51cb41d1854 Add RecoveryId getter (Tobin C. Harding)

Pull request description:

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

  Close: #774

ACKs for top commit:
  apoelstra:
    ACK fed623ef9803fe28f44e7cd331e25b9149a1154b; successfully ran local tests

Tree-SHA512: 5a341cbc78d53474a8ffa8fd7fa20796da28e67d226f0298873cd22bfa137d29642b22cabcac1bc8dcd03e6547ae5272990b315dd5808d7e5c775990705cd193
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