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
@@ -440,7 +440,7 @@ impl ChainNotify for EthSync {
|
||||
struct TxRelay(Arc<BlockChainClient>);
|
||||
|
||||
impl LightHandler for TxRelay {
|
||||
fn on_transactions(&self, ctx: &EventContext, relay: &[::ethcore::transaction::UnverifiedTransaction]) {
|
||||
fn on_transactions(&self, ctx: &EventContext, relay: &[::transaction::UnverifiedTransaction]) {
|
||||
trace!(target: "pip", "Relaying {} transactions from peer {}", relay.len(), ctx.peer());
|
||||
self.0.queue_transactions(relay.iter().map(|tx| ::rlp::encode(tx).into_vec()).collect(), ctx.peer())
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ use ethcore::header::{BlockNumber, Header as BlockHeader};
|
||||
use ethcore::client::{BlockChainClient, BlockStatus, BlockId, BlockChainInfo, BlockImportError, BlockQueueInfo};
|
||||
use ethcore::error::*;
|
||||
use ethcore::snapshot::{ManifestData, RestorationStatus};
|
||||
use ethcore::transaction::PendingTransaction;
|
||||
use transaction::PendingTransaction;
|
||||
use sync_io::SyncIo;
|
||||
use time;
|
||||
use super::SyncConfig;
|
||||
@@ -2233,8 +2233,8 @@ mod tests {
|
||||
use super::{PeerInfo, PeerAsking};
|
||||
use ethcore::header::*;
|
||||
use ethcore::client::{BlockChainClient, EachBlockWith, TestBlockChainClient};
|
||||
use ethcore::transaction::UnverifiedTransaction;
|
||||
use ethcore::miner::MinerService;
|
||||
use transaction::UnverifiedTransaction;
|
||||
|
||||
fn get_dummy_block(order: u32, parent_hash: H256) -> Bytes {
|
||||
let mut header = Header::new();
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
extern crate ethcore_network as network;
|
||||
extern crate ethcore_bytes as bytes;
|
||||
extern crate ethcore_io as io;
|
||||
extern crate ethcore_transaction as transaction;
|
||||
extern crate ethcore;
|
||||
extern crate ethereum_types;
|
||||
extern crate env_logger;
|
||||
|
||||
@@ -22,9 +22,9 @@ use ethcore::client::{BlockChainClient, Client};
|
||||
use ethcore::service::ClientIoMessage;
|
||||
use ethcore::spec::Spec;
|
||||
use ethcore::miner::MinerService;
|
||||
use ethcore::transaction::*;
|
||||
use ethcore::account_provider::AccountProvider;
|
||||
use ethkey::{KeyPair, Secret};
|
||||
use transaction::{Action, PendingTransaction, Transaction};
|
||||
use super::helpers::*;
|
||||
use SyncConfig;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user