Skip to content

Commit

Permalink
refactor(signer): small refactor in signer utils (#1615)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Nov 5, 2024
1 parent 3ff6928 commit 9b92be8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/signer/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

use alloy_primitives::{keccak256, Address};
use elliptic_curve::sec1::ToEncodedPoint;
use k256::{
ecdsa::{SigningKey, VerifyingKey},
AffinePoint,
};
use k256::ecdsa::{SigningKey, VerifyingKey};

/// Converts an ECDSA private key to its corresponding Ethereum Address.
#[inline]
Expand All @@ -16,7 +13,7 @@ pub fn secret_key_to_address(secret_key: &SigningKey) -> Address {
/// Converts an ECDSA public key to its corresponding Ethereum address.
#[inline]
pub fn public_key_to_address(pubkey: &VerifyingKey) -> Address {
let affine: &AffinePoint = pubkey.as_ref();
let affine = pubkey.as_ref();
let encoded = affine.to_encoded_point(false);
raw_public_key_to_address(&encoded.as_bytes()[1..])
}
Expand Down

0 comments on commit 9b92be8

Please sign in to comment.