Revert "FRAME: Create TransactionExtension as a replacement for SignedExtension (#2280)" (#3665)

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:
georgepisaltu
2024-03-13 16:10:59 +02:00
committed by GitHub
parent 60ac5a723c
commit bbd51ce867
350 changed files with 15826 additions and 24304 deletions
@@ -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(())