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
+1 -28
View File
@@ -20,23 +20,14 @@
use super::*;
use crate::Pallet;
use frame_benchmarking::v2::*;
use frame_support::dispatch::DispatchInfo;
use frame_system::RawOrigin;
use sp_runtime::traits::{AsSystemOriginSigner, DispatchTransaction, Dispatchable};
fn assert_last_event<T: Config>(generic_event: crate::Event<T>) {
let re: <T as Config>::RuntimeEvent = generic_event.into();
frame_system::Pallet::<T>::assert_last_event(re.into());
}
#[benchmarks(where
T: Send + Sync,
<T as Config>::RuntimeCall: From<frame_system::Call<T>>,
<T as frame_system::Config>::RuntimeCall: Dispatchable<Info = DispatchInfo>,
<<T as frame_system::Config>::RuntimeCall as Dispatchable>::PostInfo: From<()>,
<<T as frame_system::Config>::RuntimeCall as Dispatchable>::RuntimeOrigin:
AsSystemOriginSigner<T::AccountId> + Clone,
)]
#[benchmarks(where <T as Config>::RuntimeCall: From<frame_system::Call<T>>)]
mod benchmarks {
use super::*;
@@ -94,23 +85,5 @@ mod benchmarks {
assert_last_event::<T>(Event::KeyRemoved {});
}
#[benchmark]
fn check_only_sudo_account() {
let caller: T::AccountId = whitelisted_caller();
Key::<T>::put(&caller);
let call = frame_system::Call::remark { remark: vec![] }.into();
let info = DispatchInfo { ..Default::default() };
let ext = CheckOnlySudoAccount::<T>::new();
#[block]
{
assert!(ext
.test_run(RawOrigin::Signed(caller).into(), &call, &info, 0, |_| Ok(().into()))
.unwrap()
.is_ok());
}
}
impl_benchmark_test_suite!(Pallet, crate::mock::new_bench_ext(), crate::mock::Test);
}