additional (failing) sstore test

This commit is contained in:
debris 2016-03-11 20:08:01 +01:00
parent c9f5a9bc9a
commit 90e20cbcad

View File

@ -381,6 +381,7 @@ mod tests {
use super::*;
use devtools::*;
use common::*;
use crypto::KeyPair;
#[test]
fn can_insert() {
@ -555,4 +556,15 @@ mod tests {
let accounts = sstore.accounts().unwrap();
assert_eq!(30, accounts.len());
}
#[test]
fn validate_generated_addresses() {
let temp = RandomTempPath::create_dir();
let mut sstore = SecretStore::new_test(&temp);
let addr = sstore.new_account("test").unwrap();
let _ok = sstore.unlock_account(&addr, "test").unwrap();
let secret = sstore.account_secret(&addr).unwrap();
let kp = KeyPair::from_secret(secret).unwrap();
assert_eq!(Address::from(kp.public().sha3()), addr);
}
}