tendermint: PrivateKey and PublicKey have From impls for ed25519-consensus types#1401
Merged
romac merged 8 commits intocometbft:mainfrom Mar 19, 2024
Merged
Conversation
this mimics the same constructor found on `VerificationKey`, for consistency.
This was referenced Mar 18, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1401 +/- ##
=======================================
- Coverage 60.1% 59.3% -0.8%
=======================================
Files 271 271
Lines 26221 26549 +328
=======================================
- Hits 15768 15762 -6
- Misses 10453 10787 +334 ☔ View full report in Codecov by Sentry. |
PrivateKey and PublicKey have From impls for ed25519-consensus typesPrivateKey and PublicKey have From impls for ed25519-consensus types
cratelyn
added a commit
to penumbra-zone/penumbra
that referenced
this pull request
Mar 19, 2024
this updates the todo comment to point to cometbft/tendermint-rs#1401, which upstreamed a direct conversion from `ed25519_consensus`'s to `tendermint`'s representation of a public consensus key. * cometbft/tendermint-rs#1401
cratelyn
added a commit
to penumbra-zone/penumbra
that referenced
this pull request
Mar 19, 2024
this updates the todo comment to point to cometbft/tendermint-rs#1401, which upstreamed a direct conversion from `ed25519_consensus`'s to `tendermint`'s representation of a public consensus key. * cometbft/tendermint-rs#1401
melekes
added a commit
to cometbft/cometbft-rs
that referenced
this pull request
Apr 24, 2025
for `ed25519-consensus` types Port-of: cometbft/tendermint-rs#1401 Closes #29
melekes
added a commit
to cometbft/cometbft-rs
that referenced
this pull request
May 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
currently, when working with
tendermint::{PrivateKey, PublicKey}, users of theed25519-consensuscrate must convert aed25519_consensus::VerificationKeyored25519_consensus::SigningKeyviaTryFrom<&'_ [u8]>. this has the unfortunate effect of requiring a bounds check, on a value that is already known to be a valid key.this branch introduces some additional
From<T>implementations, to facilitate free conversions fromed25519-consensustypes.PrivateKeyisFrom<ed25519_consensus::SigningKey>SigningKeyisFrom<ed25519_consensus::SigningKey>PublicKeyisFrom<ed25519_consensus::VerificationKey>VerificationKeyisFrom<ed25519_consensus::VerificationKey>an internal
SigningKey::new()constructor is also added, for the sake of consistency withVerificationKey::new(). this is optional, i'd be happy to back out of that change if it seems prudent.some additional
from_ed25519_consensusmethods are provided, for cases where type inference might not suffice. these felt complimentary to existing methods likefrom_raw_ed25519, but are another optional change i'd be happy to back out of.