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
+3 -2
View File
@@ -51,6 +51,7 @@ type Number = <<node_primitives::Block as BlockT>::Header as HeaderT>::Number;
impl<Number> FactoryState<Number> {
fn build_extra(index: node_primitives::Index, phase: u64) -> node_runtime::SignedExtra {
(
system::CheckVersion::new(),
system::CheckGenesis::new(),
system::CheckEra::from(Era::mortal(256, phase)),
system::CheckNonce::from(index),
@@ -132,12 +133,12 @@ impl RuntimeAdapter for FactoryState<Number> {
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 {
let index = self.extract_index(&sender, prior_block_hash);
let phase = self.extract_phase(*prior_block_hash);
sign::<Self>(CheckedExtrinsic {
signed: Some((sender.clone(), Self::build_extra(index, phase))),
function: Call::Balances(
@@ -146,7 +147,7 @@ impl RuntimeAdapter for FactoryState<Number> {
(*amount).into()
)
)
}, key, (genesis_hash.clone(), prior_block_hash.clone(), (), (), ()))
}, key, (version, genesis_hash.clone(), prior_block_hash.clone(), (), (), ()))
}
fn inherent_extrinsics(&self) -> InherentData {