diff --git a/identity/src/ed25519.rs b/identity/src/ed25519.rs index 64c54a2f9f8..b565599d277 100644 --- a/identity/src/ed25519.rs +++ b/identity/src/ed25519.rs @@ -89,9 +89,11 @@ impl Clone for Keypair { let secret = SecretKey::from_bytes(&mut sk_bytes) .expect("ed25519::SecretKey::from_bytes(to_bytes(k)) != k") .0; - let public = ed25519::PublicKey::from_bytes(&self.0.public.to_bytes()) - .expect("ed25519::PublicKey::from_bytes(to_bytes(k)) != k"); - Keypair(ed25519::Keypair { secret, public }) + + Keypair(ed25519::Keypair { + secret, + public: self.0.public, + }) } }