EthMultiStore

This commit is contained in:
Tomasz Drwięga
2016-11-30 13:47:14 +01:00
parent 79e79473bf
commit ad440a12bd
7 changed files with 169 additions and 24 deletions

View File

@@ -18,7 +18,6 @@ use std::{fs, io};
use std::path::{PathBuf, Path};
use std::collections::HashMap;
use time;
use ethkey::Address;
use {json, SafeAccount, Error};
use json::UUID;
use super::KeyDirectory;
@@ -138,12 +137,12 @@ impl KeyDirectory for DiskDirectory {
Ok(account)
}
fn remove(&self, address: &Address) -> Result<(), Error> {
fn remove(&self, account: &SafeAccount) -> Result<(), Error> {
// enumerate all entries in keystore
// and find entry with given address
let to_remove = try!(self.files())
.into_iter()
.find(|&(_, ref account)| &account.address == address);
.find(|&(_, ref acc)| acc == account);
// remove it
match to_remove {