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
@@ -340,7 +340,7 @@ impl Service {
|
||||
// replace one the client's database with our own.
|
||||
fn replace_client_db(&self) -> Result<(), Error> {
|
||||
let migrated_blocks = self.migrate_blocks()?;
|
||||
trace!(target: "snapshot", "Migrated {} ancient blocks", migrated_blocks);
|
||||
info!(target: "snapshot", "Migrated {} ancient blocks", migrated_blocks);
|
||||
|
||||
let rest_db = self.restoration_db();
|
||||
self.client.restore_db(&*rest_db.to_string_lossy())?;
|
||||
@@ -424,7 +424,7 @@ impl Service {
|
||||
}
|
||||
|
||||
if block_number % 10_000 == 0 {
|
||||
trace!(target: "snapshot", "Block restoration at #{}", block_number);
|
||||
info!(target: "snapshot", "Block restoration at #{}", block_number);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,12 +20,12 @@ use std::cell::RefCell;
|
||||
use std::sync::Arc;
|
||||
use std::str::FromStr;
|
||||
|
||||
use account_provider::AccountProvider;
|
||||
use accounts::AccountProvider;
|
||||
use client::{Client, BlockChainClient, ChainInfo};
|
||||
use ethkey::Secret;
|
||||
use snapshot::tests::helpers as snapshot_helpers;
|
||||
use spec::Spec;
|
||||
use test_helpers::generate_dummy_client_with_spec_and_accounts;
|
||||
use test_helpers::generate_dummy_client_with_spec;
|
||||
use types::transaction::{Transaction, Action, SignedTransaction};
|
||||
use tempdir::TempDir;
|
||||
|
||||
@@ -88,8 +88,7 @@ enum Transition {
|
||||
|
||||
// create a chain with the given transitions and some blocks beyond that transition.
|
||||
fn make_chain(accounts: Arc<AccountProvider>, blocks_beyond: usize, transitions: Vec<Transition>) -> Arc<Client> {
|
||||
let client = generate_dummy_client_with_spec_and_accounts(
|
||||
spec_fixed_to_contract, Some(accounts.clone()));
|
||||
let client = generate_dummy_client_with_spec(spec_fixed_to_contract);
|
||||
|
||||
let mut cur_signers = vec![*RICH_ADDR];
|
||||
{
|
||||
@@ -100,13 +99,14 @@ fn make_chain(accounts: Arc<AccountProvider>, blocks_beyond: usize, transitions:
|
||||
{
|
||||
// push a block with given number, signed by one of the signers, with given transactions.
|
||||
let push_block = |signers: &[Address], n, txs: Vec<SignedTransaction>| {
|
||||
use miner::MinerService;
|
||||
use miner::{self, MinerService};
|
||||
|
||||
let idx = n as usize % signers.len();
|
||||
trace!(target: "snapshot", "Pushing block #{}, {} txs, author={}",
|
||||
n, txs.len(), signers[idx]);
|
||||
|
||||
client.miner().set_author(signers[idx], Some(PASS.into())).unwrap();
|
||||
let signer = Box::new((accounts.clone(), signers[idx], PASS.into()));
|
||||
client.miner().set_author(miner::Author::Sealer(signer));
|
||||
client.miner().import_external_transactions(&*client,
|
||||
txs.into_iter().map(Into::into).collect());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user