openethereum/ethstore/src/import.rs
Marek Kotewicz 6b074e8fb2 secret store separated from util (#1304)
* bump rust-crypto

* initial version of account provider utilizing secret store

* update lazy_static to latest version

* AccountProvider accounts method

* new AccountProvider tests in progress

* basic tests for new AccountProvider

* ethcore compiles with new account provider and secret store

* ethcore-rpc build now compiling with new AccountProvider

* most rpc tests passing with new accounts_provider

* fixed basic_authority tests

* fixed eth_transaction_count rpc test

* fixed mocked/eth.rs tests

* fixed personal tests

* fixed personal signer rpc tests

* removed warnings

* parity compiling fine with new sstore

* fixed import direction

* do not unlock temporarily when we have the password

* removed TODO in account import

* display warning on auto account import failure

* fixed compiling of ethstore on windows

* ethstore as a part of parity repo

* added ethkey
2016-06-20 00:10:34 +02:00

13 lines
306 B
Rust

use ethkey::Address;
use dir::KeyDirectory;
use Error;
pub fn import_accounts(src: &KeyDirectory, dst: &KeyDirectory) -> Result<Vec<Address>, Error> {
let accounts = try!(src.load());
accounts.into_iter().map(|a| {
let address = a.address.clone();
try!(dst.insert(a));
Ok(address)
}).collect()
}