Preparing light client structure [v2] (#150)

* light client structure + remote call requests
This commit is contained in:
Svyatoslav Nikolsky
2018-05-28 10:27:59 +03:00
committed by GitHub
parent 4808077674
commit 58ba901ccc
39 changed files with 1835 additions and 550 deletions
+6 -4
View File
@@ -29,7 +29,7 @@ use ed25519;
use futures::prelude::*;
use futures::{future, Canceled};
use parking_lot::Mutex;
use polkadot_api::PolkadotApi;
use polkadot_api::LocalPolkadotApi;
use polkadot_primitives::AccountId;
use polkadot_primitives::parachain::{Id as ParaId, BlockData, Extrinsic, CandidateReceipt};
use primitives::{Hash, AuthorityId};
@@ -233,15 +233,17 @@ pub struct Service {
impl Service {
/// Create and start a new instance.
pub fn new<C>(
pub fn new<A, C>(
client: Arc<C>,
api: Arc<A>,
network: Arc<net::ConsensusService>,
transaction_pool: Arc<Mutex<TransactionPool>>,
parachain_empty_duration: Duration,
key: ed25519::Pair,
) -> Service
where
C: BlockchainEvents + ChainHead + bft::BlockImport + bft::Authorities + PolkadotApi + Send + Sync + 'static,
A: LocalPolkadotApi + Send + Sync + 'static,
C: BlockchainEvents + ChainHead + bft::BlockImport + bft::Authorities + Send + Sync + 'static,
{
let (signal, exit) = ::exit_future::signal();
let thread = thread::spawn(move || {
@@ -249,7 +251,7 @@ impl Service {
let key = Arc::new(key);
let factory = ProposerFactory {
client: client.clone(),
client: api.clone(),
transaction_pool: transaction_pool.clone(),
network: Network(network.clone()),
collators: NoCollators,