mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-23 22:31:06 +00:00
Add CheckNonZeroSender to runtime configs (#4493)
* Add CheckNonZeroSender to runtime configs * cargo fmt * Fixes * Fixes * Fixes * Fixes * Fixes
This commit is contained in:
@@ -532,6 +532,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>,
|
||||||
|
|||||||
@@ -86,6 +86,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>,
|
||||||
|
|||||||
@@ -549,6 +549,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>,
|
||||||
|
|||||||
@@ -248,11 +248,12 @@ pub type UncheckedExtrinsic<Call> =
|
|||||||
pub type Address = MultiAddress<AccountId, ()>;
|
pub type Address = MultiAddress<AccountId, ()>;
|
||||||
|
|
||||||
/// A type of the data encoded as part of the transaction.
|
/// A type of the data encoded as part of the transaction.
|
||||||
pub type SignedExtra = ((), (), (), sp_runtime::generic::Era, Compact<Nonce>, (), Compact<Balance>);
|
pub type SignedExtra =
|
||||||
|
((), (), (), (), sp_runtime::generic::Era, Compact<Nonce>, (), Compact<Balance>);
|
||||||
|
|
||||||
/// Parameters which are part of the payload used to produce transaction signature,
|
/// Parameters which are part of the payload used to produce transaction signature,
|
||||||
/// but don't end up in the transaction itself (i.e. inherent part of the runtime).
|
/// but don't end up in the transaction itself (i.e. inherent part of the runtime).
|
||||||
pub type AdditionalSigned = (u32, u32, Hash, Hash, (), (), ());
|
pub type AdditionalSigned = ((), u32, u32, Hash, Hash, (), (), ());
|
||||||
|
|
||||||
/// A simplified version of signed extensions meant for producing signed transactions
|
/// A simplified version of signed extensions meant for producing signed transactions
|
||||||
/// and signed payload in the client code.
|
/// and signed payload in the client code.
|
||||||
@@ -287,6 +288,7 @@ impl<Call> SignedExtensions<Call> {
|
|||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
encode_payload: (
|
encode_payload: (
|
||||||
|
(), // non-zero sender
|
||||||
(), // spec version
|
(), // spec version
|
||||||
(), // tx version
|
(), // tx version
|
||||||
(), // genesis
|
(), // genesis
|
||||||
@@ -296,6 +298,7 @@ impl<Call> SignedExtensions<Call> {
|
|||||||
tip.into(), // transaction payment / tip (compact encoding)
|
tip.into(), // transaction payment / tip (compact encoding)
|
||||||
),
|
),
|
||||||
additional_signed: (
|
additional_signed: (
|
||||||
|
(),
|
||||||
version.spec_version,
|
version.spec_version,
|
||||||
version.transaction_version,
|
version.transaction_version,
|
||||||
genesis_hash,
|
genesis_hash,
|
||||||
@@ -312,12 +315,12 @@ impl<Call> SignedExtensions<Call> {
|
|||||||
impl<Call> SignedExtensions<Call> {
|
impl<Call> SignedExtensions<Call> {
|
||||||
/// Return signer nonce, used to craft transaction.
|
/// Return signer nonce, used to craft transaction.
|
||||||
pub fn nonce(&self) -> Nonce {
|
pub fn nonce(&self) -> Nonce {
|
||||||
self.encode_payload.4.into()
|
self.encode_payload.5.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return transaction tip.
|
/// Return transaction tip.
|
||||||
pub fn tip(&self) -> Balance {
|
pub fn tip(&self) -> Balance {
|
||||||
self.encode_payload.6.into()
|
self.encode_payload.7.into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ impl ChainInfo for PolkadotChainInfo {
|
|||||||
|
|
||||||
fn signed_extras(from: <Runtime as system::Config>::AccountId) -> Self::SignedExtras {
|
fn signed_extras(from: <Runtime as system::Config>::AccountId) -> Self::SignedExtras {
|
||||||
(
|
(
|
||||||
|
system::CheckNonZeroSender::<Runtime>::new(),
|
||||||
system::CheckSpecVersion::<Runtime>::new(),
|
system::CheckSpecVersion::<Runtime>::new(),
|
||||||
system::CheckTxVersion::<Runtime>::new(),
|
system::CheckTxVersion::<Runtime>::new(),
|
||||||
system::CheckGenesis::<Runtime>::new(),
|
system::CheckGenesis::<Runtime>::new(),
|
||||||
|
|||||||
@@ -341,6 +341,7 @@ pub fn construct_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::CheckTxVersion::<Runtime>::new(),
|
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||||
frame_system::CheckGenesis::<Runtime>::new(),
|
frame_system::CheckGenesis::<Runtime>::new(),
|
||||||
@@ -353,6 +354,7 @@ pub fn construct_extrinsic(
|
|||||||
function.clone(),
|
function.clone(),
|
||||||
extra.clone(),
|
extra.clone(),
|
||||||
(
|
(
|
||||||
|
(),
|
||||||
VERSION.spec_version,
|
VERSION.spec_version,
|
||||||
VERSION.transaction_version,
|
VERSION.transaction_version,
|
||||||
genesis_block,
|
genesis_block,
|
||||||
|
|||||||
@@ -869,6 +869,7 @@ where
|
|||||||
.saturating_sub(1);
|
.saturating_sub(1);
|
||||||
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::CheckTxVersion::<Runtime>::new(),
|
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||||
frame_system::CheckGenesis::<Runtime>::new(),
|
frame_system::CheckGenesis::<Runtime>::new(),
|
||||||
@@ -1603,6 +1604,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>,
|
||||||
|
|||||||
@@ -900,6 +900,7 @@ where
|
|||||||
.saturating_sub(1);
|
.saturating_sub(1);
|
||||||
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::CheckTxVersion::<Runtime>::new(),
|
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||||
frame_system::CheckGenesis::<Runtime>::new(),
|
frame_system::CheckGenesis::<Runtime>::new(),
|
||||||
@@ -1552,6 +1553,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>,
|
||||||
|
|||||||
@@ -438,6 +438,7 @@ mod tests {
|
|||||||
// file if you're unsure who to ping)
|
// file if you're unsure who to ping)
|
||||||
|
|
||||||
let signed_extra: crate::SignedExtra = (
|
let signed_extra: crate::SignedExtra = (
|
||||||
|
frame_system::CheckNonZeroSender::new(),
|
||||||
frame_system::CheckSpecVersion::new(),
|
frame_system::CheckSpecVersion::new(),
|
||||||
frame_system::CheckTxVersion::new(),
|
frame_system::CheckTxVersion::new(),
|
||||||
frame_system::CheckGenesis::new(),
|
frame_system::CheckGenesis::new(),
|
||||||
|
|||||||
@@ -141,6 +141,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>,
|
||||||
@@ -354,6 +355,7 @@ where
|
|||||||
.saturating_sub(1);
|
.saturating_sub(1);
|
||||||
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::CheckTxVersion::<Runtime>::new(),
|
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||||
frame_system::CheckGenesis::<Runtime>::new(),
|
frame_system::CheckGenesis::<Runtime>::new(),
|
||||||
|
|||||||
@@ -385,6 +385,7 @@ where
|
|||||||
let current_block = System::block_number().saturated_into::<u64>().saturating_sub(1);
|
let current_block = System::block_number().saturated_into::<u64>().saturating_sub(1);
|
||||||
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::CheckTxVersion::<Runtime>::new(),
|
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||||
frame_system::CheckGenesis::<Runtime>::new(),
|
frame_system::CheckGenesis::<Runtime>::new(),
|
||||||
@@ -699,6 +700,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>,
|
||||||
|
|||||||
@@ -573,6 +573,7 @@ where
|
|||||||
.saturating_sub(1);
|
.saturating_sub(1);
|
||||||
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::CheckTxVersion::<Runtime>::new(),
|
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||||
frame_system::CheckGenesis::<Runtime>::new(),
|
frame_system::CheckGenesis::<Runtime>::new(),
|
||||||
@@ -1172,6 +1173,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>,
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ fn signed_ext_builder_polkadot(
|
|||||||
) -> polkadot_runtime_exports::SignedExtra {
|
) -> polkadot_runtime_exports::SignedExtra {
|
||||||
use polkadot_runtime_exports::Runtime;
|
use polkadot_runtime_exports::Runtime;
|
||||||
(
|
(
|
||||||
|
frame_system::CheckNonZeroSender::<Runtime>::new(),
|
||||||
frame_system::CheckSpecVersion::<Runtime>::new(),
|
frame_system::CheckSpecVersion::<Runtime>::new(),
|
||||||
frame_system::CheckTxVersion::<Runtime>::new(),
|
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||||
frame_system::CheckGenesis::<Runtime>::new(),
|
frame_system::CheckGenesis::<Runtime>::new(),
|
||||||
@@ -133,6 +134,7 @@ fn signed_ext_builder_kusama(
|
|||||||
) -> kusama_runtime_exports::SignedExtra {
|
) -> kusama_runtime_exports::SignedExtra {
|
||||||
use kusama_runtime_exports::Runtime;
|
use kusama_runtime_exports::Runtime;
|
||||||
(
|
(
|
||||||
|
frame_system::CheckNonZeroSender::<Runtime>::new(),
|
||||||
frame_system::CheckSpecVersion::<Runtime>::new(),
|
frame_system::CheckSpecVersion::<Runtime>::new(),
|
||||||
frame_system::CheckTxVersion::<Runtime>::new(),
|
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||||
frame_system::CheckGenesis::<Runtime>::new(),
|
frame_system::CheckGenesis::<Runtime>::new(),
|
||||||
@@ -150,6 +152,7 @@ fn signed_ext_builder_westend(
|
|||||||
) -> westend_runtime_exports::SignedExtra {
|
) -> westend_runtime_exports::SignedExtra {
|
||||||
use westend_runtime_exports::Runtime;
|
use westend_runtime_exports::Runtime;
|
||||||
(
|
(
|
||||||
|
frame_system::CheckNonZeroSender::<Runtime>::new(),
|
||||||
frame_system::CheckSpecVersion::<Runtime>::new(),
|
frame_system::CheckSpecVersion::<Runtime>::new(),
|
||||||
frame_system::CheckTxVersion::<Runtime>::new(),
|
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||||
frame_system::CheckGenesis::<Runtime>::new(),
|
frame_system::CheckGenesis::<Runtime>::new(),
|
||||||
|
|||||||
Reference in New Issue
Block a user