Create an account for chain=dev (#5612)

* implement From<&'static str> for Secret

* Dev account.

* Fix Secret semantics.
This commit is contained in:
Tomasz Drwięga
2017-05-19 17:06:36 +02:00
committed by Gav Wood
parent e7abd3510a
commit 3ff72794e5
27 changed files with 83 additions and 45 deletions

View File

@@ -122,7 +122,7 @@ impl Crypto {
}
let secret = self.do_decrypt(password, 32)?;
Ok(Secret::from_slice(&secret)?)
Ok(Secret::from_unsafe_slice(&secret)?)
}
/// Try to decrypt and return result as is

View File

@@ -50,7 +50,7 @@ impl PresaleWallet {
let len = crypto::aes::decrypt_cbc(&derived_key, &self.iv, &self.ciphertext, &mut key).map_err(|_| Error::InvalidPassword)?;
let unpadded = &key[..len];
let secret = Secret::from_slice(&unpadded.keccak256())?;
let secret = Secret::from_unsafe_slice(&unpadded.keccak256())?;
if let Ok(kp) = KeyPair::from_secret(secret) {
if kp.address() == self.address {
return Ok(kp)