Export account RPC (#4967)
* Export account RPC * Removing GethDirectory and ParityDirectory * Updating ethstore-cli help.
This commit is contained in:
@@ -20,6 +20,7 @@ use std::collections::BTreeMap;
|
||||
use util::{Address};
|
||||
|
||||
use ethkey::{Brain, Generator, Secret};
|
||||
use ethstore::KeyFile;
|
||||
use ethcore::account_provider::AccountProvider;
|
||||
|
||||
use jsonrpc_core::Error;
|
||||
@@ -315,6 +316,17 @@ impl ParityAccounts for ParityAccountsClient {
|
||||
.map(Into::into)
|
||||
.map_err(|e| errors::account("Could not derive account.", e))
|
||||
}
|
||||
|
||||
fn export_account(&self, addr: RpcH160, password: String) -> Result<KeyFile, Error> {
|
||||
let addr = addr.into();
|
||||
take_weak!(self.accounts)
|
||||
.export_account(
|
||||
&addr,
|
||||
password,
|
||||
)
|
||||
.map(Into::into)
|
||||
.map_err(|e| errors::account("Could not export account.", e))
|
||||
}
|
||||
}
|
||||
|
||||
fn into_vec<A, B>(a: Vec<A>) -> Vec<B> where
|
||||
|
||||
Reference in New Issue
Block a user