mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 09:55:40 +00:00
This PR reverts #2280 which introduced `TransactionExtension` to replace `SignedExtension`. As a result of the discussion [here](https://github.com/paritytech/polkadot-sdk/pull/3623#issuecomment-1986789700), the changes will be reverted for now with plans to reintroduce the concept in the future. --------- Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
This commit is contained in:
@@ -18,12 +18,9 @@ use crate as pallet_skip_feeless_payment;
|
||||
|
||||
use frame_support::{derive_impl, parameter_types};
|
||||
use frame_system as system;
|
||||
use sp_runtime::{
|
||||
impl_tx_ext_default,
|
||||
traits::{OriginOf, TransactionExtension},
|
||||
};
|
||||
|
||||
type Block = frame_system::mocking::MockBlock<Runtime>;
|
||||
type AccountId = u64;
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
|
||||
impl frame_system::Config for Runtime {
|
||||
@@ -41,22 +38,21 @@ parameter_types! {
|
||||
#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, TypeInfo)]
|
||||
pub struct DummyExtension;
|
||||
|
||||
impl TransactionExtensionBase for DummyExtension {
|
||||
const IDENTIFIER: &'static str = "DummyExtension";
|
||||
type Implicit = ();
|
||||
}
|
||||
impl<C> TransactionExtension<RuntimeCall, C> for DummyExtension {
|
||||
type Val = ();
|
||||
impl SignedExtension for DummyExtension {
|
||||
type AccountId = AccountId;
|
||||
type Call = RuntimeCall;
|
||||
type AdditionalSigned = ();
|
||||
type Pre = ();
|
||||
impl_tx_ext_default!(RuntimeCall; C; validate);
|
||||
fn prepare(
|
||||
const IDENTIFIER: &'static str = "DummyExtension";
|
||||
fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> {
|
||||
Ok(())
|
||||
}
|
||||
fn pre_dispatch(
|
||||
self,
|
||||
_val: Self::Val,
|
||||
_origin: &OriginOf<RuntimeCall>,
|
||||
_call: &RuntimeCall,
|
||||
_info: &DispatchInfoOf<RuntimeCall>,
|
||||
_who: &Self::AccountId,
|
||||
_call: &Self::Call,
|
||||
_info: &DispatchInfoOf<Self::Call>,
|
||||
_len: usize,
|
||||
_context: &C,
|
||||
) -> Result<Self::Pre, TransactionValidityError> {
|
||||
PreDispatchCount::mutate(|c| *c += 1);
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user