-
Notifications
You must be signed in to change notification settings - Fork 227
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
tendermint: PrivateKey
and PublicKey
have From
impls for ed25519-consensus
types
#1401
tendermint: PrivateKey
and PublicKey
have From
impls for ed25519-consensus
types
#1401
Conversation
this mimics the same constructor found on `VerificationKey`, for consistency.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks! 💐
PrivateKey
and PublicKey
have From
impls for ed25519-consensus
typesPrivateKey
and PublicKey
have From
impls for ed25519-consensus
types
this updates the todo comment to point to informalsystems/tendermint-rs#1401, which upstreamed a direct conversion from `ed25519_consensus`'s to `tendermint`'s representation of a public consensus key. * informalsystems/tendermint-rs#1401
this updates the todo comment to point to informalsystems/tendermint-rs#1401, which upstreamed a direct conversion from `ed25519_consensus`'s to `tendermint`'s representation of a public consensus key. * informalsystems/tendermint-rs#1401
currently, when working with
tendermint::{PrivateKey, PublicKey}
, users of theed25519-consensus
crate must convert aed25519_consensus::VerificationKey
ored25519_consensus::SigningKey
viaTryFrom<&'_ [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-consensus
types.PrivateKey
isFrom<ed25519_consensus::SigningKey>
SigningKey
isFrom<ed25519_consensus::SigningKey>
PublicKey
isFrom<ed25519_consensus::VerificationKey>
VerificationKey
isFrom<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_consensus
methods 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.