Skip to content

Commit

Permalink
naming
Browse files Browse the repository at this point in the history
  • Loading branch information
v4lproik committed Jan 15, 2024
1 parent c66a0e8 commit 1bc5416
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub fn decrypt_keystore_v3<S>(keystore: EthKeystoreV3, password: S) -> Result<Ve
pub fn encrypt_key_v3<P, R, B, S>(
dir: P,
rng: &mut R,
pk: B,
priv_key: B,
password: S,
name: Option<&str>,
) -> Result<String, KeystoreError>
Expand All @@ -153,7 +153,7 @@ pub fn encrypt_key_v3<P, R, B, S>(
B: AsRef<[u8]>,
S: AsRef<[u8]>,
{
let keystore = encrypt_keystore_v3(rng, pk, password)?;
let keystore = encrypt_keystore_v3(rng, priv_key, password)?;

// Set the keystore id to the provided name or to the generated uuid while encrypting the keystore
let id = if let Some(name) = name {
Expand Down Expand Up @@ -340,7 +340,7 @@ pub fn decrypt_keystore_v4<S>(keystore: EthKeystoreV4, password: S) -> Result<Ve
pub fn encrypt_key_v4<P, R, B, S>(
dir: P,
rng: &mut R,
pk: B,
priv_key: B,
password: S,
name: Option<&str>,
) -> Result<String, KeystoreError>
Expand All @@ -350,7 +350,8 @@ pub fn encrypt_key_v4<P, R, B, S>(
B: AsRef<[u8]>,
S: AsRef<[u8]>,
{
let keystore = encrypt_keystore_v4(rng, pk, None::<&str>, password)?;
let pub_key = None::<&str>;
let keystore = encrypt_keystore_v4(rng, priv_key, pub_key, password)?;

// Set the keystore id to the provided name or to the generated uuid while encrypting the keystore
let id = if let Some(name) = name {
Expand Down

0 comments on commit 1bc5416

Please sign in to comment.