mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user