Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fix(compilation warns): no-default-features (#10346)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasad1 authored and ordian committed Feb 14, 2019
1 parent bff0bed commit 9cce6a4
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion parity/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub struct ImportFromGethAccounts {


#[cfg(not(feature = "accounts"))]
pub fn execute(cmd: AccountCmd) -> Result<String, String> {
pub fn execute(_cmd: AccountCmd) -> Result<String, String> {
Err("Account management is deprecated. Please see #9997 for alternatives:\nhttps://github.com/paritytech/parity-ethereum/issues/9997".into())
}

Expand Down
4 changes: 2 additions & 2 deletions parity/account_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AccountProvider, String> {
pub fn prepare_account_provider(_spec: &SpecType, _dirs: &Directories, _data_dir: &str, _cfg: AccountsConfig, _passwords: &[Password]) -> Result<AccountProvider, String> {
warn!("Note: Your instance of Parity Ethereum is running without account support. Some CLI options are ignored.");
Ok(AccountProvider)
}
Expand Down
1 change: 1 addition & 0 deletions parity/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
1 change: 1 addition & 0 deletions rpc/src/v1/helpers/dispatch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions rpc/src/v1/helpers/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -336,6 +338,7 @@ pub fn fetch<T: fmt::Debug>(error: T) -> Error {
}
}

#[cfg(any(test, feature = "accounts"))]
pub fn invalid_call_data<T: fmt::Display>(error: T) -> Error {
Error {
code: ErrorCode::ServerError(codes::ENCODING_ERROR),
Expand Down
2 changes: 2 additions & 0 deletions rpc/src/v1/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions rpc/src/v1/types/derivation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ impl From<DeriveHash> for Derive {
}

/// Error converting request data
#[cfg(any(test, feature = "accounts"))]
#[derive(Debug)]
pub enum ConvertError {
IndexOverlfow(u64),
}

impl Derive {
/// Convert to account provider struct dealing with possible overflows
#[cfg(any(test, feature = "accounts"))]
pub fn to_derivation(self) -> Result<ethstore::Derivation, ConvertError> {
Ok(match self {
Derive::Hierarchical(drv) => {
Expand Down

0 comments on commit 9cce6a4

Please sign in to comment.