Add CheckNonZeroSender to runtime configs (#847)

* Add CheckNonZeroSender to runtime configs

* cargo update -p polkadot-primitives

* Fixes

* Fixes
This commit is contained in:
Keith Yeung
2021-12-09 05:53:51 -08:00
committed by GitHub
parent b5135277f4
commit 9e9ff9e5d0
9 changed files with 250 additions and 240 deletions
+240 -238
View File
File diff suppressed because it is too large Load Diff
@@ -96,6 +96,7 @@ pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic. /// The SignedExtension to the basic transaction logic.
pub type SignedExtra = ( pub type SignedExtra = (
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>, frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckTxVersion<Runtime>, frame_system::CheckTxVersion<Runtime>,
frame_system::CheckGenesis<Runtime>, frame_system::CheckGenesis<Runtime>,
@@ -556,6 +556,7 @@ pub type SignedBlock = generic::SignedBlock<Block>;
pub type BlockId = generic::BlockId<Block>; pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic. /// The SignedExtension to the basic transaction logic.
pub type SignedExtra = ( pub type SignedExtra = (
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>, frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckGenesis<Runtime>, frame_system::CheckGenesis<Runtime>,
frame_system::CheckEra<Runtime>, frame_system::CheckEra<Runtime>,
@@ -751,6 +751,7 @@ pub type SignedBlock = generic::SignedBlock<Block>;
pub type BlockId = generic::BlockId<Block>; pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic. /// The SignedExtension to the basic transaction logic.
pub type SignedExtra = ( pub type SignedExtra = (
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>, frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckTxVersion<Runtime>, frame_system::CheckTxVersion<Runtime>,
frame_system::CheckGenesis<Runtime>, frame_system::CheckGenesis<Runtime>,
@@ -763,6 +763,7 @@ pub type SignedBlock = generic::SignedBlock<Block>;
pub type BlockId = generic::BlockId<Block>; pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic. /// The SignedExtension to the basic transaction logic.
pub type SignedExtra = ( pub type SignedExtra = (
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>, frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckTxVersion<Runtime>, frame_system::CheckTxVersion<Runtime>,
frame_system::CheckGenesis<Runtime>, frame_system::CheckGenesis<Runtime>,
@@ -749,6 +749,7 @@ pub type SignedBlock = generic::SignedBlock<Block>;
pub type BlockId = generic::BlockId<Block>; pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic. /// The SignedExtension to the basic transaction logic.
pub type SignedExtra = ( pub type SignedExtra = (
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>, frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckTxVersion<Runtime>, frame_system::CheckTxVersion<Runtime>,
frame_system::CheckGenesis<Runtime>, frame_system::CheckGenesis<Runtime>,
+2 -1
View File
@@ -132,6 +132,7 @@ pub fn generate_extrinsic(
BlockHashCount::get().checked_next_power_of_two().map(|c| c / 2).unwrap_or(2) as u64; BlockHashCount::get().checked_next_power_of_two().map(|c| c / 2).unwrap_or(2) as u64;
let tip = 0; let tip = 0;
let extra: SignedExtra = ( let extra: SignedExtra = (
frame_system::CheckNonZeroSender::<Runtime>::new(),
frame_system::CheckSpecVersion::<Runtime>::new(), frame_system::CheckSpecVersion::<Runtime>::new(),
frame_system::CheckGenesis::<Runtime>::new(), frame_system::CheckGenesis::<Runtime>::new(),
frame_system::CheckEra::<Runtime>::from(Era::mortal(period, current_block)), frame_system::CheckEra::<Runtime>::from(Era::mortal(period, current_block)),
@@ -145,7 +146,7 @@ pub fn generate_extrinsic(
let raw_payload = SignedPayload::from_raw( let raw_payload = SignedPayload::from_raw(
function.clone(), function.clone(),
extra.clone(), extra.clone(),
(VERSION.spec_version, genesis_block, current_block_hash, (), (), ()), ((), VERSION.spec_version, genesis_block, current_block_hash, (), (), ()),
); );
let signature = raw_payload.using_encoded(|e| origin.sign(e)); let signature = raw_payload.using_encoded(|e| origin.sign(e));
+1
View File
@@ -314,6 +314,7 @@ pub type SignedBlock = generic::SignedBlock<Block>;
pub type BlockId = generic::BlockId<Block>; pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic. /// The SignedExtension to the basic transaction logic.
pub type SignedExtra = ( pub type SignedExtra = (
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>, frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckGenesis<Runtime>, frame_system::CheckGenesis<Runtime>,
frame_system::CheckEra<Runtime>, frame_system::CheckEra<Runtime>,
+2 -1
View File
@@ -701,6 +701,7 @@ pub fn construct_extrinsic(
.unwrap_or(2) as u64; .unwrap_or(2) as u64;
let tip = 0; let tip = 0;
let extra: runtime::SignedExtra = ( let extra: runtime::SignedExtra = (
frame_system::CheckNonZeroSender::<runtime::Runtime>::new(),
frame_system::CheckSpecVersion::<runtime::Runtime>::new(), frame_system::CheckSpecVersion::<runtime::Runtime>::new(),
frame_system::CheckGenesis::<runtime::Runtime>::new(), frame_system::CheckGenesis::<runtime::Runtime>::new(),
frame_system::CheckEra::<runtime::Runtime>::from(generic::Era::mortal( frame_system::CheckEra::<runtime::Runtime>::from(generic::Era::mortal(
@@ -714,7 +715,7 @@ pub fn construct_extrinsic(
let raw_payload = runtime::SignedPayload::from_raw( let raw_payload = runtime::SignedPayload::from_raw(
function.clone(), function.clone(),
extra.clone(), extra.clone(),
(runtime::VERSION.spec_version, genesis_block, current_block_hash, (), (), ()), ((), runtime::VERSION.spec_version, genesis_block, current_block_hash, (), (), ()),
); );
let signature = raw_payload.using_encoded(|e| caller.sign(e)); let signature = raw_payload.using_encoded(|e| caller.sign(e));
runtime::UncheckedExtrinsic::new_signed( runtime::UncheckedExtrinsic::new_signed(