Extract some parts of miner from ethcore. (#7353)
* Move miner away from ethcore. * Fix ethcore to use miner/transaction. * Fix tests and warnings. * fixed incorrect merge of the test in the documentation
This commit is contained in:
committed by
Marek Kotewicz
parent
9a12945304
commit
f044b61f42
@@ -1137,7 +1137,8 @@ mod tests {
|
||||
|
||||
use devtools::{RandomTempPath};
|
||||
use ethcore::client::{VMType, BlockId};
|
||||
use ethcore::miner::{MinerOptions, PrioritizationStrategy};
|
||||
use ethcore::miner::MinerOptions;
|
||||
use miner::transaction_queue::PrioritizationStrategy;
|
||||
use parity_rpc::NetworkSettings;
|
||||
use updater::{UpdatePolicy, UpdateFilter, ReleaseTrack};
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
|
||||
use bytes::Bytes;
|
||||
use dir::default_data_path;
|
||||
use dir::helpers::replace_home;
|
||||
use ethcore::client::{Client, BlockChainClient, BlockId};
|
||||
use ethcore::transaction::{Transaction, Action};
|
||||
use ethsync::LightSync;
|
||||
use futures::{future, IntoFuture, Future};
|
||||
use hash_fetch::fetch::Client as FetchClient;
|
||||
@@ -30,8 +30,8 @@ use light::on_demand::{self, OnDemand};
|
||||
use node_health::{SyncStatus, NodeHealth};
|
||||
use rpc;
|
||||
use rpc_apis::SignerService;
|
||||
use transaction::{Transaction, Action};
|
||||
use ethereum_types::Address;
|
||||
use bytes::Bytes;
|
||||
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
pub struct Configuration {
|
||||
|
||||
@@ -22,7 +22,8 @@ use ethereum_types::{U256, clean_0x, Address};
|
||||
use kvdb_rocksdb::CompactionProfile;
|
||||
use journaldb::Algorithm;
|
||||
use ethcore::client::{Mode, BlockId, VMType, DatabaseCompactionProfile, ClientConfig, VerifierType};
|
||||
use ethcore::miner::{PendingSet, GasLimit, PrioritizationStrategy};
|
||||
use ethcore::miner::{PendingSet, GasLimit};
|
||||
use miner::transaction_queue::PrioritizationStrategy;
|
||||
use cache::CacheConfig;
|
||||
use dir::DatabaseDirectories;
|
||||
use dir::helpers::replace_home;
|
||||
|
||||
@@ -47,12 +47,14 @@ extern crate time;
|
||||
extern crate toml;
|
||||
|
||||
extern crate ethcore;
|
||||
extern crate ethcore_bytes as bytes;
|
||||
extern crate ethcore_devtools as devtools;
|
||||
extern crate ethcore_io as io;
|
||||
extern crate ethcore_light as light;
|
||||
extern crate ethcore_logger;
|
||||
extern crate ethcore_bytes as bytes;
|
||||
extern crate ethcore_miner as miner;
|
||||
extern crate ethcore_network as network;
|
||||
extern crate ethcore_transaction as transaction;
|
||||
extern crate ethereum_types;
|
||||
extern crate migration as migr;
|
||||
extern crate kvdb;
|
||||
|
||||
@@ -24,21 +24,22 @@ pub use parity_rpc::dapps::{DappsService, LocalDapp};
|
||||
|
||||
use ethcore::account_provider::AccountProvider;
|
||||
use ethcore::client::Client;
|
||||
use ethcore::miner::{Miner, ExternalMiner};
|
||||
use ethcore::miner::Miner;
|
||||
use ethcore::snapshot::SnapshotService;
|
||||
use ethcore_logger::RotatingLogger;
|
||||
use ethsync::{ManageNetwork, SyncProvider, LightSync};
|
||||
use hash_fetch::fetch::Client as FetchClient;
|
||||
use jsonrpc_core::{self as core, MetaIoHandler};
|
||||
use light::{TransactionQueue as LightTransactionQueue, Cache as LightDataCache};
|
||||
use light::client::LightChainClient;
|
||||
use light::{TransactionQueue as LightTransactionQueue, Cache as LightDataCache};
|
||||
use miner::external::ExternalMiner;
|
||||
use node_health::NodeHealth;
|
||||
use parity_reactor;
|
||||
use parity_rpc::dispatch::{FullDispatcher, LightDispatcher};
|
||||
use parity_rpc::informant::{ActivityNotifier, ClientNotifier};
|
||||
use parity_rpc::{Metadata, NetworkSettings, Host};
|
||||
use updater::Updater;
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
use updater::Updater;
|
||||
|
||||
#[derive(Debug, PartialEq, Clone, Eq, Hash)]
|
||||
pub enum Api {
|
||||
|
||||
@@ -18,31 +18,32 @@ use std::fmt;
|
||||
use std::sync::{Arc, Weak};
|
||||
use std::net::{TcpListener};
|
||||
|
||||
use ansi_term::Colour;
|
||||
use ctrlc::CtrlC;
|
||||
use ethcore_logger::{Config as LogConfig, RotatingLogger};
|
||||
use ethcore::account_provider::{AccountProvider, AccountProviderSettings};
|
||||
use ethcore::client::{Client, Mode, DatabaseCompactionProfile, VMType, BlockChainClient};
|
||||
use ethcore::ethstore::ethkey;
|
||||
use ethcore::miner::{Miner, MinerService, ExternalMiner, MinerOptions};
|
||||
use ethcore::miner::{Miner, MinerService, MinerOptions};
|
||||
use ethcore::miner::{StratumOptions, Stratum};
|
||||
use ethcore::service::ClientService;
|
||||
use ethcore::snapshot;
|
||||
use ethcore::spec::{SpecParams, OptimizeFor};
|
||||
use ethcore::verification::queue::VerifierSettings;
|
||||
use ethcore_logger::{Config as LogConfig, RotatingLogger};
|
||||
use ethsync::{self, SyncConfig};
|
||||
use fdlimit::raise_fd_limit;
|
||||
use hash_fetch::fetch::{Fetch, Client as FetchClient};
|
||||
use informant::{Informant, LightNodeInformantData, FullNodeInformantData};
|
||||
use journaldb::Algorithm;
|
||||
use light::Cache as LightDataCache;
|
||||
use miner::external::ExternalMiner;
|
||||
use node_filter::NodeFilter;
|
||||
use node_health;
|
||||
use parity_reactor::EventLoop;
|
||||
use parity_rpc::{NetworkSettings, informant, is_major_importing};
|
||||
use updater::{UpdatePolicy, Updater};
|
||||
use ansi_term::Colour;
|
||||
use parity_version::version;
|
||||
use parking_lot::{Condvar, Mutex};
|
||||
use node_filter::NodeFilter;
|
||||
use journaldb::Algorithm;
|
||||
use updater::{UpdatePolicy, Updater};
|
||||
use parity_version::version;
|
||||
|
||||
use params::{
|
||||
SpecType, Pruning, AccountsConfig, GasPricerConfig, MinerExtras, Switch,
|
||||
@@ -156,7 +157,7 @@ struct FullNodeInfo {
|
||||
}
|
||||
|
||||
impl ::local_store::NodeInfo for FullNodeInfo {
|
||||
fn pending_transactions(&self) -> Vec<::ethcore::transaction::PendingTransaction> {
|
||||
fn pending_transactions(&self) -> Vec<::transaction::PendingTransaction> {
|
||||
let miner = match self.miner.as_ref() {
|
||||
Some(m) => m,
|
||||
None => return Vec::new(),
|
||||
|
||||
Reference in New Issue
Block a user