From d9101b9559a01205a54319540493191cfb5c25b7 Mon Sep 17 00:00:00 2001 From: Arkadiy Paronyan Date: Wed, 19 Jul 2017 10:18:30 +0200 Subject: [PATCH] Fixed ethkey CLI build (#6086) --- ethcore/res/ethereum/tests | 2 +- ethkey/cli/src/main.rs | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ethcore/res/ethereum/tests b/ethcore/res/ethereum/tests index ef191fdc6..4e8b9be3f 160000 --- a/ethcore/res/ethereum/tests +++ b/ethcore/res/ethereum/tests @@ -1 +1 @@ -Subproject commit ef191fdc61cf76cdb9cdc147465fb447304b0ed2 +Subproject commit 4e8b9be3fba16ec32e0cdf50b8f9329826283aaa diff --git a/ethkey/cli/src/main.rs b/ethkey/cli/src/main.rs index 0d96c2a89..a47abbbab 100644 --- a/ethkey/cli/src/main.rs +++ b/ethkey/cli/src/main.rs @@ -26,6 +26,7 @@ use std::num::ParseIntError; use docopt::Docopt; use rustc_hex::{FromHex, FromHexError}; use ethkey::{KeyPair, Random, Brain, Prefix, Error as EthkeyError, Generator, sign, verify_public, verify_address}; +use std::io; pub const USAGE: &'static str = r#" Ethereum keys generator. @@ -87,6 +88,7 @@ enum Error { FromHex(FromHexError), ParseInt(ParseIntError), Docopt(docopt::Error), + Io(io::Error), } impl From for Error { @@ -113,6 +115,12 @@ impl From for Error { } } +impl From for Error { + fn from(err: io::Error) -> Self { + Error::Io(err) + } +} + impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { match *self { @@ -120,6 +128,7 @@ impl fmt::Display for Error { Error::FromHex(ref e) => write!(f, "{}", e), Error::ParseInt(ref e) => write!(f, "{}", e), Error::Docopt(ref e) => write!(f, "{}", e), + Error::Io(ref e) => write!(f, "{}", e), } } } @@ -176,17 +185,17 @@ fn execute(command: I) -> Result where I: IntoIterator