Skip to content

Commit

Permalink
debug: Detailed parse error.
Browse files Browse the repository at this point in the history
  • Loading branch information
koxu1996 committed Feb 6, 2024
1 parent 65c3eb3 commit 9a75210
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions kairos-cli/bin/crypto/private_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ impl CasperPrivateKey {
}

pub fn from_file(file_path: &str) -> Result<Self, CryptoError> {
let secret_key = casper_types::SecretKey::from_file(file_path)
.map_err(|_e| CryptoError::FailedToParseKey {})?;
let secret_key = casper_types::SecretKey::from_file(file_path).map_err(|e| {
println!("WHOOPS: {:?}", e);
CryptoError::FailedToParseKey {}
})?;
Ok(Self(secret_key))
}
}
6 changes: 4 additions & 2 deletions kairos-cli/bin/crypto/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ impl CasperSigner {
}

pub fn from_file(secret_key_path: &str) -> Result<Self, CryptoError> {
let secret_key =
SecretKey::from_file(secret_key_path).map_err(|_| CryptoError::FailedToParseKey {})?;
let secret_key = SecretKey::from_file(secret_key_path).map_err(|e| {
println!("WHOOPS: {:?}", e);
CryptoError::FailedToParseKey {}
})?;

Ok(Self::from_key(CasperPrivateKey::from_key(secret_key)))
}
Expand Down

0 comments on commit 9a75210

Please sign in to comment.