Skip to content

Commit

Permalink
fix features
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumExplorer committed Oct 6, 2024
1 parent a0e5e0d commit 4d838f0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/rs-dpp/src/identity/identity_public_key/key_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,8 @@ impl KeyType {
match self {
KeyType::ECDSA_SECP256K1 => {
let secp = Secp256k1::new();
let secret_key =
dashcore::secp256k1::SecretKey::from_slice(private_key_bytes)
.map_err(|e| ProtocolError::Generic(e.to_string()))?;
let secret_key = dashcore::secp256k1::SecretKey::from_slice(private_key_bytes)
.map_err(|e| ProtocolError::Generic(e.to_string()))?;
let private_key = dashcore::PrivateKey::new(secret_key, network);

Ok(private_key.public_key(&secp).to_bytes())
Expand All @@ -237,9 +236,8 @@ impl KeyType {
}
KeyType::ECDSA_HASH160 => {
let secp = Secp256k1::new();
let secret_key =
dashcore::secp256k1::SecretKey::from_slice(private_key_bytes)
.map_err(|e| ProtocolError::Generic(e.to_string()))?;
let secret_key = dashcore::secp256k1::SecretKey::from_slice(private_key_bytes)
.map_err(|e| ProtocolError::Generic(e.to_string()))?;
let private_key = dashcore::PrivateKey::new(secret_key, network);

Ok(ripemd160_sha256(private_key.public_key(&secp).to_bytes().as_slice()).to_vec())
Expand Down

0 comments on commit 4d838f0

Please # to comment.