Skip to content

Commit

Permalink
Remove CasperPublicKey::from_key().
Browse files Browse the repository at this point in the history
It can be constructed directly via public field.
  • Loading branch information
koxu1996 committed Feb 13, 2024
1 parent 8b78660 commit 72d333c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions kairos-cli/bin/crypto/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<u8>, CryptoError> {
self.0.to_bytes().map_err(|_e| CryptoError::Serialization {
Expand Down
2 changes: 1 addition & 1 deletion kairos-cli/bin/crypto/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 72d333c

Please sign in to comment.