Add ‘transaction_version’ to the signed transaction (#1092)

This allows hardware wallets to know which transactions they can safely
sign.
This commit is contained in:
Demi Obenour
2020-05-14 22:58:25 +00:00
committed by GitHub
parent cb1e21cb0c
commit c45b14d1f3
4 changed files with 16 additions and 8 deletions
+4 -2
View File
@@ -595,7 +595,8 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
let tip = 0;
let extra: SignedExtra = (
RestrictFunctionality,
system::CheckVersion::<Runtime>::new(),
system::CheckSpecVersion::<Runtime>::new(),
system::CheckTxVersion::<Runtime>::new(),
system::CheckGenesis::<Runtime>::new(),
system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)),
system::CheckNonce::<Runtime>::from(nonce),
@@ -845,7 +846,8 @@ pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic.
pub type SignedExtra = (
RestrictFunctionality,
system::CheckVersion<Runtime>,
system::CheckSpecVersion<Runtime>,
system::CheckTxVersion<Runtime>,
system::CheckGenesis<Runtime>,
system::CheckEra<Runtime>,
system::CheckNonce<Runtime>,
+4 -2
View File
@@ -602,7 +602,8 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
let tip = 0;
let extra: SignedExtra = (
OnlyStakingAndClaims,
system::CheckVersion::<Runtime>::new(),
system::CheckSpecVersion::<Runtime>::new(),
system::CheckTxVersion::<Runtime>::new(),
system::CheckGenesis::<Runtime>::new(),
system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)),
system::CheckNonce::<Runtime>::from(nonce),
@@ -760,7 +761,8 @@ pub type BlockId = generic::BlockId<Block>;
pub type SignedExtra = (
// RELEASE: remove this for release build.
OnlyStakingAndClaims,
system::CheckVersion<Runtime>,
system::CheckSpecVersion<Runtime>,
system::CheckTxVersion<Runtime>,
system::CheckGenesis<Runtime>,
system::CheckEra<Runtime>,
system::CheckNonce<Runtime>,
+4 -2
View File
@@ -394,7 +394,8 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
let tip = 0;
let extra: SignedExtra = (
RestrictFunctionality,
system::CheckVersion::<Runtime>::new(),
system::CheckSpecVersion::<Runtime>::new(),
system::CheckTxVersion::<Runtime>::new(),
system::CheckGenesis::<Runtime>::new(),
system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)),
system::CheckNonce::<Runtime>::from(nonce),
@@ -531,7 +532,8 @@ pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic.
pub type SignedExtra = (
RestrictFunctionality,
system::CheckVersion<Runtime>,
system::CheckSpecVersion<Runtime>,
system::CheckTxVersion<Runtime>,
system::CheckGenesis<Runtime>,
system::CheckEra<Runtime>,
system::CheckNonce<Runtime>,
+4 -2
View File
@@ -454,7 +454,8 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
let tip = 0;
let extra: SignedExtra = (
RestrictFunctionality,
system::CheckVersion::<Runtime>::new(),
system::CheckSpecVersion::<Runtime>::new(),
system::CheckTxVersion::<Runtime>::new(),
system::CheckGenesis::<Runtime>::new(),
system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)),
system::CheckNonce::<Runtime>::from(nonce),
@@ -645,7 +646,8 @@ pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic.
pub type SignedExtra = (
RestrictFunctionality,
system::CheckVersion<Runtime>,
system::CheckSpecVersion<Runtime>,
system::CheckTxVersion<Runtime>,
system::CheckGenesis<Runtime>,
system::CheckEra<Runtime>,
system::CheckNonce<Runtime>,