Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Prev Previous commit
Next Next commit
fix error convert
  • Loading branch information
cheme committed Jun 30, 2020
commit cf77ff392f76d79e420d0bd1c5b811948180a254
6 changes: 4 additions & 2 deletions client/cli/src/params/keystore_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ impl KeystoreParams {
#[cfg(not(target_os = "unknown"))]
{
let mut password = input_keystore_password()?;
let secret = std::str::FromStr::from_str(password.as_str())?;
let secret = std::str::FromStr::from_str(password.as_str())
.map_err(|()| "Error reading password")?;
use sp_core::crypto::Zeroize;
password.zeroize();
Some(secret)
Expand All @@ -75,7 +76,8 @@ impl KeystoreParams {
} else if let Some(ref file) = self.password_filename {
let mut password = fs::read_to_string(file)
.map_err(|e| format!("{}", e))?;
let secret = std::str::FromStr::from_str(password.as_str())?;
let secret = std::str::FromStr::from_str(password.as_str())
.map_err(|()| "Error reading password")?;
use sp_core::crypto::Zeroize;
password.zeroize();
Some(secret)
Expand Down