Check the genesis hash in transactions regardless of era. (#3286)

* Check the genesis hash in transactions regardless of era.

* Fix check-fees, too.

* Undo.

* Subkey supports new signing.

* Remove unneeded type param.

* Bump tx version

* Build.

* Another build fix

* Build again

* Cleanup

* Another fix.

* Fix

* Fixes

* 6 second blocks.

* Fixes

* Build fix

* Fix

* Fix.
This commit is contained in:
Gavin Wood
2019-08-02 18:30:20 +02:00
committed by GitHub
parent ae6c2f7f8c
commit 7927e80bc6
16 changed files with 102 additions and 116 deletions
@@ -25,7 +25,7 @@ use crate::codec::{Decode, Encode, Input};
use crate::traits::{self, Member, MaybeDisplay, SignedExtension, Checkable, Extrinsic};
use super::CheckedExtrinsic;
const TRANSACTION_VERSION: u8 = 2;
const TRANSACTION_VERSION: u8 = 3;
/// A extrinsic right from the external world. This is unchecked and so
/// can contain a signature.
@@ -205,7 +205,7 @@ mod tests {
use super::*;
use runtime_io::blake2_256;
use crate::codec::{Encode, Decode};
use crate::traits::{SignedExtension, BlockNumberToHash, Lookup, CurrentHeight};
use crate::traits::{SignedExtension, Lookup};
use serde::{Serialize, Deserialize};
struct TestContext;
@@ -214,15 +214,6 @@ mod tests {
type Target = u64;
fn lookup(&self, s: u64) -> Result<u64, &'static str> { Ok(s) }
}
impl CurrentHeight for TestContext {
type BlockNumber = u64;
fn current_height(&self) -> u64 { 42 }
}
impl BlockNumberToHash for TestContext {
type BlockNumber = u64;
type Hash = u64;
fn block_number_to_hash(&self, n: u64) -> Option<u64> { Some(n) }
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Encode, Decode)]
struct TestSig(u64, Vec<u8>);