Make node-template in sync with node. (#3422)

* Make node-template in sync with node.

* Update service.rs

* Updated babe constants.

* Added SignedExtra for CheckVersion in node-template and subkey.

* Added CheckVersion SignedExtra for node.

* Fixed tests.

* Try fix integration test.

* Attempt 2 at fixing integration test.

* Update node-template/runtime/src/lib.rs
This commit is contained in:
Gautam Dhameja
2019-08-19 09:17:33 +02:00
committed by Gavin Wood
parent 8eacdb54de
commit 0bb44f5024
15 changed files with 456 additions and 181 deletions
@@ -54,6 +54,7 @@ use crate::{RuntimeAdapter, create_block};
pub fn next<F, RA>(
factory_state: &mut RA,
client: &Arc<ComponentClient<FullComponents<F>>>,
version: u32,
genesis_hash: <RA::Block as BlockT>::Hash,
prior_block_hash: <RA::Block as BlockT>::Hash,
prior_block_id: BlockId<F::Block>,
@@ -92,6 +93,7 @@ where
&from.1,
&to,
&amount,
version,
&genesis_hash,
&prior_block_hash,
);
@@ -77,6 +77,7 @@ pub trait RuntimeAdapter {
key: &Self::Secret,
destination: &Self::AccountId,
amount: &Self::Balance,
version: u32,
genesis_hash: &<Self::Block as BlockT>::Hash,
prior_block_hash: &<Self::Block as BlockT>::Hash,
) -> <Self::Block as BlockT>::Extrinsic;
@@ -119,6 +120,7 @@ where
select_chain.best_chain().map_err(|e| format!("{:?}", e).into());
let mut best_hash = best_header?.hash();
let best_block_id = BlockId::<F::Block>::hash(best_hash);
let version = client.runtime_version_at(&best_block_id)?.spec_version;
let genesis_hash = client.block_hash(Zero::zero())?
.expect("Genesis block always exists; qed").into();
@@ -126,6 +128,7 @@ where
Mode::MasterToNToM => complex_mode::next::<F, RA>(
&mut factory_state,
&client,
version,
genesis_hash,
best_hash.into(),
best_block_id,
@@ -133,6 +136,7 @@ where
_ => simple_modes::next::<F, RA>(
&mut factory_state,
&client,
version,
genesis_hash,
best_hash.into(),
best_block_id,
@@ -49,6 +49,7 @@ use crate::{Mode, RuntimeAdapter, create_block};
pub fn next<F, RA>(
factory_state: &mut RA,
client: &Arc<ComponentClient<FullComponents<F>>>,
version: u32,
genesis_hash: <RA::Block as BlockT>::Hash,
prior_block_hash: <RA::Block as BlockT>::Hash,
prior_block_id: BlockId<F::Block>,
@@ -83,6 +84,7 @@ where
&from.1,
&to,
&amount,
version,
&genesis_hash,
&prior_block_hash,
);