Skip to content

Commit

Permalink
Remove roundtripping
Browse files Browse the repository at this point in the history
  • Loading branch information
kckeiks committed Oct 21, 2022
1 parent ea54bbd commit f1f6ee4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions core/src/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,7 @@ impl TryFrom<keys_proto::PublicKey> for PublicKey {
type Error = DecodingError;

fn try_from(pubkey: keys_proto::PublicKey) -> Result<Self, Self::Error> {
use protobuf::Enum;

let key_type = keys_proto::KeyType::from_i32(pubkey.Type().value())
.ok_or_else(|| DecodingError::new(format!("unknown key type: {}", pubkey.Type().value())))?;

match key_type {
match pubkey.Type() {
keys_proto::KeyType::Ed25519 => {
ed25519::PublicKey::decode(&pubkey.Data()).map(PublicKey::Ed25519)
}
Expand Down

0 comments on commit f1f6ee4

Please sign in to comment.