diff --git a/parity/account.rs b/parity/account.rs index 578e9e7ef..118c06fdd 100644 --- a/parity/account.rs +++ b/parity/account.rs @@ -58,7 +58,7 @@ pub struct ImportFromGethAccounts { #[cfg(not(feature = "accounts"))] -pub fn execute(cmd: AccountCmd) -> Result { +pub fn execute(_cmd: AccountCmd) -> Result { Err("Account management is deprecated. Please see #9997 for alternatives:\nhttps://github.com/paritytech/parity-ethereum/issues/9997".into()) } diff --git a/parity/account_utils.rs b/parity/account_utils.rs index caaad53e1..6c11ae23b 100644 --- a/parity/account_utils.rs +++ b/parity/account_utils.rs @@ -30,12 +30,12 @@ mod accounts { pub struct AccountProvider; impl ::ethcore::miner::LocalAccounts for AccountProvider { - fn is_local(&self, address: &Address) -> bool { + fn is_local(&self, _address: &Address) -> bool { false } } - pub fn prepare_account_provider(_spec: &SpecType, _dirs: &Directories, _data_dir: &str, cfg: AccountsConfig, _passwords: &[Password]) -> Result { + pub fn prepare_account_provider(_spec: &SpecType, _dirs: &Directories, _data_dir: &str, _cfg: AccountsConfig, _passwords: &[Password]) -> Result { warn!("Note: Your instance of Parity Ethereum is running without account support. Some CLI options are ignored."); Ok(AccountProvider) } diff --git a/parity/upgrade.rs b/parity/upgrade.rs index 3406e573c..aa3f6eba1 100644 --- a/parity/upgrade.rs +++ b/parity/upgrade.rs @@ -139,6 +139,7 @@ fn file_exists(path: &Path) -> bool { } } +#[cfg(any(test, feature = "accounts"))] pub fn upgrade_key_location(from: &PathBuf, to: &PathBuf) { match fs::create_dir_all(&to).and_then(|()| fs::read_dir(from)) { Ok(entries) => { diff --git a/rpc/src/v1/helpers/dispatch/mod.rs b/rpc/src/v1/helpers/dispatch/mod.rs index 6df1e8848..d23619f41 100644 --- a/rpc/src/v1/helpers/dispatch/mod.rs +++ b/rpc/src/v1/helpers/dispatch/mod.rs @@ -201,6 +201,7 @@ pub enum SignWith { } impl SignWith { + #[cfg(any(test, feature = "accounts"))] fn is_password(&self) -> bool { if let SignWith::Password(_) = *self { true diff --git a/rpc/src/v1/helpers/errors.rs b/rpc/src/v1/helpers/errors.rs index 30607fde6..eebd76dbe 100644 --- a/rpc/src/v1/helpers/errors.rs +++ b/rpc/src/v1/helpers/errors.rs @@ -43,7 +43,9 @@ mod codes { pub const EXECUTION_ERROR: i64 = -32015; pub const EXCEPTION_ERROR: i64 = -32016; pub const DATABASE_ERROR: i64 = -32017; + #[cfg(any(test, feature = "accounts"))] pub const ACCOUNT_LOCKED: i64 = -32020; + #[cfg(any(test, feature = "accounts"))] pub const PASSWORD_INVALID: i64 = -32021; pub const ACCOUNT_ERROR: i64 = -32023; pub const PRIVATE_ERROR: i64 = -32024; @@ -336,6 +338,7 @@ pub fn fetch(error: T) -> Error { } } +#[cfg(any(test, feature = "accounts"))] pub fn invalid_call_data(error: T) -> Error { Error { code: ErrorCode::ServerError(codes::ENCODING_ERROR), diff --git a/rpc/src/v1/helpers/mod.rs b/rpc/src/v1/helpers/mod.rs index 59a62deb7..8a25f9305 100644 --- a/rpc/src/v1/helpers/mod.rs +++ b/rpc/src/v1/helpers/mod.rs @@ -20,6 +20,7 @@ pub mod errors; pub mod block_import; pub mod deprecated; pub mod dispatch; +#[cfg(any(test, feature = "accounts"))] pub mod eip191; #[cfg(any(test, feature = "accounts"))] pub mod engine_signer; @@ -28,6 +29,7 @@ pub mod fake_sign; pub mod ipfs; pub mod light_fetch; pub mod nonce; +#[cfg(any(test, feature = "accounts"))] pub mod secretstore; mod network_settings; diff --git a/rpc/src/v1/types/derivation.rs b/rpc/src/v1/types/derivation.rs index a2947a89f..4c2f66512 100644 --- a/rpc/src/v1/types/derivation.rs +++ b/rpc/src/v1/types/derivation.rs @@ -70,6 +70,7 @@ impl From for Derive { } /// Error converting request data +#[cfg(any(test, feature = "accounts"))] #[derive(Debug)] pub enum ConvertError { IndexOverlfow(u64), @@ -77,6 +78,7 @@ pub enum ConvertError { impl Derive { /// Convert to account provider struct dealing with possible overflows + #[cfg(any(test, feature = "accounts"))] pub fn to_derivation(self) -> Result { Ok(match self { Derive::Hierarchical(drv) => {