Skip to content
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

Rename KeyPair to Keypair #648

Merged
merged 1 commit into from
Aug 20, 2023
Merged

Conversation

tcharding
Copy link
Member

We use "keypair" in identifiers (local vars and function names) but KeyPair - one of them is wrong.

Elect to follow upstream and define keypair as a single word i.e., use Keypair for type name and keypair in identifiers.

This patch can be reproduced mechanically by doing two search-and-replace operations on all files excluding the CHANGELOG

  • Replace "KeyPair" with "Keypair"
  • Replace "key_pair" with "keypair"

Fix #647

We use "keypair" in identifiers (local vars and function names) but
`KeyPair` - one of them is wrong.

Elect to follow upstream and define keypair as a single word i.e., use
`Keypair` for type name and `keypair` in identifiers.

This patch can be reproduced mechanically by doing two
search-and-replace operations on all files excluding the CHANGELOG

- Replace "KeyPair" with "Keypair"
- Replace "key_pair" with "keypair"
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 33747bb

@apoelstra apoelstra merged commit d9aadc6 into rust-bitcoin:master Aug 20, 2023
@tcharding tcharding deleted the 08-19-keypair branch August 24, 2023 02:35
@Kixunil
Copy link
Collaborator

Kixunil commented Oct 14, 2023

I think this will be quite unintuitive for most rustceans and also breaks the API IMO unnecessarily :(

@apoelstra
Copy link
Member

@Kixunil I have never seen "keypair" split into two words, and might even have trouble understanding it if I read it.

I agree that in an API, somehow the two-word version feels nicer, but it doesn't match the libsecp API or any documentation.

@Kixunil
Copy link
Collaborator

Kixunil commented Oct 14, 2023

Ah, this is classic issue with people being new to this kind of cryptography - they may not realize it's usually one word. I'm not even new and I just don't remember. So I guess there's no real solution and let's just not make more work.

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.

keypair does not match KeyPair
3 participants