Deprecate account management (#10213)
* Extract accounts from ethcore. * Fix ethcore. * Get rid of AccountProvider in test_helpers * Fix rest of the code. * Re-use EngineSigner, fix tests. * Simplify EngineSigner to always have an Address. * Fix RPC tests. * Add deprecation notice to RPCs. * Feature to disable accounts. * extract accounts in RPC * Run with accounts in tests. * Fix RPC compilation and tests. * Fix compilation of the binary. * Fix compilation of the binary. * Fix compilation with accounts enabled. * Fix tests. * Update submodule. * Remove android. * Use derive for Default * Don't build secretstore by default. * Add link to issue. * Refresh Cargo.lock. * Fix miner tests. * Update rpc/Cargo.toml Co-Authored-By: tomusdrw <tomusdrw@users.noreply.github.com> * Fix private tests.
This commit is contained in:
committed by
Afri Schoedon
parent
8fa56add47
commit
d5c19f8719
@@ -29,7 +29,7 @@ use parity_version::{version_data, version};
|
||||
use bytes::Bytes;
|
||||
use ansi_term::Colour;
|
||||
use sync::{NetworkConfiguration, validate_node_url, self};
|
||||
use ethstore::ethkey::{Secret, Public};
|
||||
use ethkey::{Secret, Public};
|
||||
use ethcore::client::{VMType};
|
||||
use ethcore::miner::{stratum, MinerOptions};
|
||||
use ethcore::snapshot::SnapshotConfiguration;
|
||||
@@ -40,7 +40,7 @@ use num_cpus;
|
||||
use rpc::{IpcConfiguration, HttpConfiguration, WsConfiguration};
|
||||
use parity_rpc::NetworkSettings;
|
||||
use cache::CacheConfig;
|
||||
use helpers::{to_duration, to_mode, to_block_id, to_u256, to_pending_set, to_price, geth_ipc_path, parity_ipc_path, to_bootnodes, to_addresses, to_address, to_queue_strategy, to_queue_penalization, passwords_from_files};
|
||||
use helpers::{to_duration, to_mode, to_block_id, to_u256, to_pending_set, to_price, geth_ipc_path, parity_ipc_path, to_bootnodes, to_addresses, to_address, to_queue_strategy, to_queue_penalization};
|
||||
use dir::helpers::{replace_home, replace_home_and_local};
|
||||
use params::{ResealPolicy, AccountsConfig, GasPricerConfig, MinerExtras, SpecType};
|
||||
use ethcore_logger::Config as LogConfig;
|
||||
@@ -442,6 +442,7 @@ impl Configuration {
|
||||
gas_range_target: (floor, ceil),
|
||||
engine_signer: self.engine_signer()?,
|
||||
work_notify: self.work_notify(),
|
||||
local_accounts: HashSet::from_iter(to_addresses(&self.args.arg_tx_queue_locals)?.into_iter()),
|
||||
};
|
||||
|
||||
Ok(extras)
|
||||
@@ -579,7 +580,6 @@ impl Configuration {
|
||||
infinite_pending_block: self.args.flag_infinite_pending_block,
|
||||
|
||||
tx_queue_penalization: to_queue_penalization(self.args.arg_tx_time_limit)?,
|
||||
tx_queue_locals: HashSet::from_iter(to_addresses(&self.args.arg_tx_queue_locals)?.into_iter()),
|
||||
tx_queue_strategy: to_queue_strategy(&self.args.arg_tx_queue_strategy)?,
|
||||
tx_queue_no_unfamiliar_locals: self.args.flag_tx_queue_no_unfamiliar_locals,
|
||||
refuse_service_transactions: self.args.flag_refuse_service_transactions,
|
||||
@@ -916,20 +916,12 @@ impl Configuration {
|
||||
let provider_conf = ProviderConfig {
|
||||
validator_accounts: to_addresses(&self.args.arg_private_validators)?,
|
||||
signer_account: self.args.arg_private_signer.clone().and_then(|account| to_address(Some(account)).ok()),
|
||||
passwords: match self.args.arg_private_passwords.clone() {
|
||||
Some(file) => passwords_from_files(&vec![file].as_slice())?,
|
||||
None => Vec::new(),
|
||||
},
|
||||
};
|
||||
|
||||
let encryptor_conf = EncryptorConfig {
|
||||
base_url: self.args.arg_private_sstore_url.clone(),
|
||||
threshold: self.args.arg_private_sstore_threshold.unwrap_or(0),
|
||||
key_server_account: self.args.arg_private_account.clone().and_then(|account| to_address(Some(account)).ok()),
|
||||
passwords: match self.args.arg_private_passwords.clone() {
|
||||
Some(file) => passwords_from_files(&vec![file].as_slice())?,
|
||||
None => Vec::new(),
|
||||
},
|
||||
};
|
||||
|
||||
Ok((provider_conf, encryptor_conf, self.args.flag_private_enabled))
|
||||
@@ -1070,6 +1062,7 @@ impl Configuration {
|
||||
match self.args.arg_secretstore_secret {
|
||||
Some(ref s) if s.len() == 64 => Ok(Some(NodeSecretKey::Plain(s.parse()
|
||||
.map_err(|e| format!("Invalid secret store secret: {}. Error: {:?}", s, e))?))),
|
||||
#[cfg(feature = "accounts")]
|
||||
Some(ref s) if s.len() == 40 => Ok(Some(NodeSecretKey::KeyStore(s.parse()
|
||||
.map_err(|e| format!("Invalid secret store secret address: {}. Error: {:?}", s, e))?))),
|
||||
Some(_) => Err(format!("Invalid secret store secret. Must be either existing account address, or hex-encoded private key")),
|
||||
|
||||
Reference in New Issue
Block a user