Use authorities from Authorities runtime API, not Core (#248)

This commit is contained in:
Stanislav Tkach
2019-05-07 18:05:02 +03:00
committed by Robert Habermeier
parent a65be1b2df
commit 4e9fb2d2b5
6 changed files with 12 additions and 5 deletions
+2
View File
@@ -2273,6 +2273,7 @@ dependencies = [
"polkadot-runtime 0.1.0",
"polkadot-validation 0.1.0",
"substrate-client 1.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"substrate-consensus-authorities 1.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"substrate-keyring 1.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"substrate-primitives 1.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"tokio 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2459,6 +2460,7 @@ dependencies = [
"substrate-client 1.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"substrate-consensus-aura 1.1.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"substrate-consensus-aura-primitives 1.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"substrate-consensus-authorities 1.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"substrate-consensus-common 1.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"substrate-finality-grandpa 1.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"substrate-inherents 1.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
+1
View File
@@ -9,6 +9,7 @@ futures = "0.1.17"
substrate-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
parity-codec = "3.0"
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-consensus-authorities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
polkadot-runtime = { path = "../runtime", version = "0.1" }
polkadot-primitives = { path = "../primitives", version = "0.1" }
polkadot-cli = { path = "../cli" }
+3 -1
View File
@@ -48,6 +48,7 @@ extern crate futures;
extern crate substrate_client as client;
extern crate parity_codec as codec;
extern crate substrate_primitives as primitives;
extern crate substrate_consensus_authorities as consensus_authorities;
extern crate tokio;
extern crate polkadot_cli;
@@ -75,11 +76,12 @@ use polkadot_primitives::parachain::{
self, BlockData, DutyRoster, HeadData, ConsolidatedIngress, Message, Id as ParaId, Extrinsic,
PoVBlock,
};
use polkadot_cli::{PolkadotService, CustomConfiguration, CoreApi, ParachainHost};
use polkadot_cli::{PolkadotService, CustomConfiguration, ParachainHost};
use polkadot_cli::{Worker, IntoExit, ProvideRuntimeApi, TaskExecutor};
use polkadot_network::validation::{ValidationNetwork, SessionParams};
use polkadot_network::NetworkService;
use tokio::timer::Timeout;
use consensus_authorities::AuthoritiesApi;
pub use polkadot_cli::VersionInfo;
pub use polkadot_network::validation::Incoming;
+1
View File
@@ -27,6 +27,7 @@ srml-aura = { git = "https://github.com/paritytech/substrate", branch = "polkado
substrate-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sr-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-consensus-authorities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
[dev-dependencies]
substrate-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
@@ -30,13 +30,13 @@ use std::sync::Arc;
use client::{error::Result as ClientResult, BlockchainEvents, ChainHead, BlockBody};
use client::block_builder::api::BlockBuilder;
use client::blockchain::HeaderBackend;
use client::runtime_api::Core;
use primitives::ed25519;
use futures::prelude::*;
use polkadot_primitives::{Block, BlockId};
use polkadot_primitives::parachain::{CandidateReceipt, ParachainHost};
use extrinsic_store::Store as ExtrinsicStore;
use runtime_primitives::traits::{ProvideRuntimeApi, Header as HeaderT};
use consensus_authorities::AuthoritiesApi;
use tokio::runtime::TaskExecutor;
use tokio::runtime::current_thread::Runtime as LocalRuntime;
@@ -114,7 +114,7 @@ pub(crate) fn start<C, N, P>(
<C::Collation as IntoFuture>::Future: Send + 'static,
P: BlockchainEvents<Block> + ChainHead<Block> + BlockBody<Block>,
P: ProvideRuntimeApi + HeaderBackend<Block> + Send + Sync + 'static,
P::Api: ParachainHost<Block> + Core<Block> + BlockBuilder<Block>,
P::Api: ParachainHost<Block> + BlockBuilder<Block> + AuthoritiesApi<Block>,
N: Network + Send + Sync + 'static,
N::TableRouter: Send + 'static,
<N::BuildTableRouter as IntoFuture>::Future: Send + 'static,
+3 -2
View File
@@ -51,6 +51,7 @@ extern crate substrate_consensus_aura as aura;
extern crate substrate_consensus_aura_primitives as aura_primitives;
extern crate substrate_finality_grandpa as grandpa;
extern crate substrate_transaction_pool as transaction_pool;
extern crate substrate_consensus_authorities as consensus_authorities;
#[macro_use]
extern crate error_chain;
@@ -72,7 +73,6 @@ use aura::SlotDuration;
use client::{BlockchainEvents, ChainHead, BlockBody};
use client::blockchain::HeaderBackend;
use client::block_builder::api::BlockBuilder as BlockBuilderApi;
use client::runtime_api::Core;
use codec::Encode;
use extrinsic_store::Store as ExtrinsicStore;
use parking_lot::Mutex;
@@ -87,6 +87,7 @@ use runtime_primitives::{traits::{ProvideRuntimeApi, Header as HeaderT}, ApplyEr
use tokio::runtime::TaskExecutor;
use tokio::timer::{Delay, Interval};
use transaction_pool::txpool::{Pool, ChainApi as PoolChainApi};
use consensus_authorities::AuthoritiesApi;
use attestation_service::ServiceHandle;
use futures::prelude::*;
@@ -468,7 +469,7 @@ impl<C, N, P, TxApi> ProposerFactory<C, N, P, TxApi> where
<C::Collation as IntoFuture>::Future: Send + 'static,
P: BlockchainEvents<Block> + ChainHead<Block> + BlockBody<Block>,
P: ProvideRuntimeApi + HeaderBackend<Block> + Send + Sync + 'static,
P::Api: ParachainHost<Block> + Core<Block> + BlockBuilderApi<Block>,
P::Api: ParachainHost<Block> + BlockBuilderApi<Block> + AuthoritiesApi<Block>,
N: Network + Send + Sync + 'static,
N::TableRouter: Send + 'static,
<N::BuildTableRouter as IntoFuture>::Future: Send + 'static,