8000 Add `ChainHash::from_genesis_block_hash` by Kixunil · Pull Request #1753 · rust-bitcoin/rust-bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add ChainHash::from_genesis_block_hash #1753

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

Conversation

Kixunil
Copy link
Collaborator
@Kixunil Kixunil commented Mar 26, 2023

This improves readability of converting BlockHash into ChainHash. It's useful in e.g. Electrum protocol which sends BlockHash (serialized backward).

Closes #1751

This improves readability of converting `BlockHash` into `ChainHash`.
It's useful in e.g. Electrum protocol which sends `BlockHash`
(serialized backward).

Closes rust-bitcoin#1751
@Kixunil Kixunil added enhancement trivial Obvious, easy and quick to review (few lines or doc-only...) labels Mar 26, 2023
@apoelstra
Copy link
Member

We should also have From<BlockHash> and vice-versa since AFAICT these are exactly the same object, just serialized differently.

@Kixunil
Copy link
Collaborator Author
Kixunil commented Mar 27, 2023

Not really, ChainHash can be non-blockhash value and it needs genesis block specifically, not any arbitrary block, so explicit name like here is better.

@apoelstra
Copy link
Member

Ok, that sounds reasonable.

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 ed80df5

Copy link
Member
@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK ed80df5

@apoelstra apoelstra merged commit dc72dfb into rust-bitcoin:master Mar 28, 2023
@Kixunil Kixunil deleted the chain_hash_from_genensis_block_hash branch March 28, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement trivial Obvious, easy and quick to review (few lines or doc-only...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ChainHash::from_genesis_block_hash(BlockHash) method
3 participants
0