From 72d333c22d8de19c00ea4debfa6d9a3a808fb893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Bro=C5=84ski?= Date: Tue, 13 Feb 2024 16:55:54 +0100 Subject: [PATCH] Remove `CasperPublicKey::from_key()`. It can be constructed directly via public field. --- kairos-cli/bin/crypto/public_key.rs | 4 ---- kairos-cli/bin/crypto/signer.rs | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/kairos-cli/bin/crypto/public_key.rs b/kairos-cli/bin/crypto/public_key.rs index 42824d0f..f3a10045 100644 --- a/kairos-cli/bin/crypto/public_key.rs +++ b/kairos-cli/bin/crypto/public_key.rs @@ -15,10 +15,6 @@ impl CasperPublicKey { Ok(Self(public_key)) } - pub fn from_key(public_key: casper_types::PublicKey) -> Self { - Self(public_key) - } - #[allow(unused)] fn to_bytes(&self) -> Result, CryptoError> { self.0.to_bytes().map_err(|_e| CryptoError::Serialization { diff --git a/kairos-cli/bin/crypto/signer.rs b/kairos-cli/bin/crypto/signer.rs index 91ff99e7..de35e0a8 100644 --- a/kairos-cli/bin/crypto/signer.rs +++ b/kairos-cli/bin/crypto/signer.rs @@ -17,7 +17,7 @@ impl CasperSigner { let secret_key = CasperPrivateKey::from_file(file_path)?; // Derive the public key. - let public_key = CasperPublicKey::from_key(PublicKey::from(&secret_key.0)); + let public_key = CasperPublicKey(PublicKey::from(&secret_key.0)); Ok(CasperSigner { secret_key,