Update to latest substrate (#66)

* Update to latest substrate

* Fix as much as I can

* Store key out of Environment::init

* Fix service compile
This commit is contained in:
Gav Wood
2019-01-08 14:08:31 +01:00
committed by GitHub
parent b2db7857a7
commit f66b5115fd
10 changed files with 200 additions and 120 deletions
+1 -1
View File
@@ -16,7 +16,7 @@
//! Errors that can occur during the consensus process.
use primitives::AuthorityId;
use primitives::Ed25519AuthorityId as AuthorityId;
use runtime_primitives::RuntimeString;
error_chain! {
+5 -3
View File
@@ -77,7 +77,7 @@ use polkadot_primitives::{
};
use polkadot_primitives::parachain::{Id as ParaId, Chain, DutyRoster, BlockData, Extrinsic as ParachainExtrinsic, CandidateReceipt, CandidateSignature};
use polkadot_primitives::parachain::{AttestedCandidate, ParachainHost, Statement as PrimitiveStatement};
use primitives::{AuthorityId, ed25519};
use primitives::{Ed25519AuthorityId as AuthorityId, ed25519};
use runtime_primitives::traits::ProvideRuntimeApi;
use tokio::runtime::TaskExecutor;
use tokio::timer::{Delay, Interval};
@@ -348,6 +348,7 @@ struct AttestationTracker {
pub struct ProposerFactory<C, N, P, TxApi: PoolChainApi> {
parachain_consensus: Arc<ParachainConsensus<C, N, P>>,
transaction_pool: Arc<Pool<TxApi>>,
key: Arc<ed25519::Pair>,
_service_handle: ServiceHandle,
}
@@ -384,13 +385,14 @@ impl<C, N, P, TxApi> ProposerFactory<C, N, P, TxApi> where
client,
parachain_consensus.clone(),
thread_pool,
key,
key.clone(),
extrinsic_store,
);
ProposerFactory {
parachain_consensus,
transaction_pool,
key,
_service_handle: service_handle,
}
}
@@ -412,10 +414,10 @@ impl<C, N, P, TxApi> consensus::Environment<Block, AuraConsensusData> for Propos
&self,
parent_header: &Header,
authorities: &[AuthorityId],
sign_with: Arc<ed25519::Pair>,
) -> Result<Self::Proposer, Error> {
let parent_hash = parent_header.hash();
let parent_id = BlockId::hash(parent_hash);
let sign_with = self.key.clone();
let tracker = self.parachain_consensus.get_or_instantiate(
parent_hash,
authorities,