Companion for #11981 (#5915)

* Companion for #11981

* more renaming

* fmt

* fixes

* add generic type

* Companion for #11831

* fix

* revert changes

* Delete rename-outer-enum.diff

* revert

* Update run_benches_for_runtime.sh

* rename type Call & type Event

* passing tests

* fmt

* small fixes

* commit

* fix

* fmt

* commit

* error fixes

* fix

* small fix in test

* Update lib.rs

* Update lib.rs

* Update lib.rs

* Update lib.rs

* Update lib.rs

* Update lib.rs

* Update lib.rs

* remove RuntimeCall from pallet_grandpa

* last fix

* commit

* rename

* merge fix

* update lockfile for {"substrate"}

* cargo +nightly fmt

* fix

Co-authored-by: parity-processbot <>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Sergej Sakac
2022-09-13 01:03:47 +02:00
committed by GitHub
parent db0fc60344
commit 8ea6076fe5
73 changed files with 1241 additions and 1151 deletions
+16 -16
View File
@@ -51,10 +51,10 @@ pub mod pallet_test_notifier {
#[pallet::config]
pub trait Config: frame_system::Config + crate::Config {
type Event: IsType<<Self as frame_system::Config>::Event> + From<Event<Self>>;
type RuntimeEvent: IsType<<Self as frame_system::Config>::RuntimeEvent> + From<Event<Self>>;
type Origin: IsType<<Self as frame_system::Config>::Origin>
+ Into<Result<crate::Origin, <Self as Config>::Origin>>;
type Call: IsType<<Self as crate::Config>::Call> + From<Call<Self>>;
type RuntimeCall: IsType<<Self as crate::Config>::RuntimeCall> + From<Call<Self>>;
}
#[pallet::event]
@@ -97,7 +97,7 @@ pub mod pallet_test_notifier {
Call::<T>::notification_received { query_id: 0, response: Default::default() };
let qid = crate::Pallet::<T>::new_notify_query(
Junction::AccountId32 { network: Any, id }.into(),
<T as Config>::Call::from(call),
<T as Config>::RuntimeCall::from(call),
100u32.into(),
);
Self::deposit_event(Event::<T>::NotifyQueryPrepared(qid));
@@ -172,7 +172,7 @@ parameter_types! {
impl frame_system::Config for Test {
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = u64;
type Hash = H256;
@@ -180,7 +180,7 @@ impl frame_system::Config for Test {
type AccountId = AccountId;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type BlockWeights = ();
type BlockLength = ();
@@ -206,7 +206,7 @@ parameter_types! {
impl pallet_balances::Config for Test {
type MaxLocks = MaxLocks;
type Balance = Balance;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
@@ -251,7 +251,7 @@ pub type Barrier = (
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type Call = Call;
type RuntimeCall = RuntimeCall;
type XcmSender = TestSendXcm;
type AssetTransactor = LocalAssetTransactor;
type OriginConverter = LocalOriginConverter;
@@ -259,7 +259,7 @@ impl xcm_executor::Config for XcmConfig {
type IsTeleporter = Case<TrustedAssets>;
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
type Weigher = FixedWeightBounds<BaseXcmWeight, RuntimeCall, MaxInstructions>;
type Trader = FixedRateOfFungible<CurrencyPerSecond, ()>;
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
@@ -274,7 +274,7 @@ parameter_types! {
}
impl pallet_xcm::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<Origin, LocalOriginToLocation>;
type XcmRouter = (TestSendXcmErrX8, TestSendXcm);
type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin<Origin, LocalOriginToLocation>;
@@ -282,10 +282,10 @@ impl pallet_xcm::Config for Test {
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = Everything;
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
type Weigher = FixedWeightBounds<BaseXcmWeight, RuntimeCall, MaxInstructions>;
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = AdvertisedXcmVersion;
}
@@ -293,16 +293,16 @@ impl pallet_xcm::Config for Test {
impl origin::Config for Test {}
impl pallet_test_notifier::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
}
pub(crate) fn last_event() -> Event {
System::events().pop().expect("Event expected").event
pub(crate) fn last_event() -> RuntimeEvent {
System::events().pop().expect("RuntimeEvent expected").event
}
pub(crate) fn last_events(n: usize) -> Vec<Event> {
pub(crate) fn last_events(n: usize) -> Vec<RuntimeEvent> {
System::events().into_iter().map(|e| e.event).rev().take(n).rev().collect()
}