From d3fb9deaa15479130202a5c06040893752be0b2f Mon Sep 17 00:00:00 2001 From: Sergej Sakac <73715684+Szegoo@users.noreply.github.com> Date: Tue, 13 Sep 2022 01:55:33 +0200 Subject: [PATCH] Companion for #11981 (#1563) * Companion for #11981 * rename * Event to RuntimeEvent in imports * missed rename * undo * revert * rename type Call & Event * commit * ... * fix * fix errors * fixes * fmt * fix imports * final fix? * fmt * fix? * fixes after merge * small fix * cargo update -p polkadot-runtime-common * cargo +nightly fmt * update lockfile for {"polkadot", "substrate"} * fix Co-authored-by: Shawn Tabrizi Co-authored-by: parity-processbot <> --- .../collator-selection/src/benchmarking.rs | 4 +- cumulus/pallets/collator-selection/src/lib.rs | 2 +- .../pallets/collator-selection/src/mock.rs | 10 +- cumulus/parachain-template/runtime/src/lib.rs | 31 ++-- .../runtime/src/xcm_config.rs | 25 ++-- cumulus/parachains/common/src/impls.rs | 12 +- cumulus/parachains/common/src/xcm_config.rs | 8 +- cumulus/parachains/pallets/ping/src/lib.rs | 8 +- .../runtimes/assets/statemine/src/lib.rs | 141 ++++++++++-------- .../assets/statemine/src/xcm_config.rs | 26 ++-- .../runtimes/assets/statemint/src/lib.rs | 141 ++++++++++-------- .../assets/statemint/src/xcm_config.rs | 26 ++-- .../runtimes/assets/westmint/src/lib.rs | 141 ++++++++++-------- .../assets/westmint/src/xcm_config.rs | 26 ++-- .../collectives-polkadot/src/lib.rs | 65 ++++---- .../collectives-polkadot/src/xcm_config.rs | 16 +- .../contracts-rococo/src/contracts.rs | 8 +- .../contracts/contracts-rococo/src/lib.rs | 37 ++--- .../contracts-rococo/src/xcm_config.rs | 20 +-- .../runtimes/starters/seedling/src/lib.rs | 17 ++- .../runtimes/starters/shell/src/lib.rs | 13 +- .../runtimes/starters/shell/src/xcm_config.rs | 8 +- .../runtimes/testing/penpal/src/lib.rs | 37 ++--- .../runtimes/testing/penpal/src/xcm_config.rs | 24 +-- .../testing/rococo-parachain/src/lib.rs | 47 +++--- cumulus/test/runtime/src/lib.rs | 21 +-- 26 files changed, 489 insertions(+), 425 deletions(-) diff --git a/cumulus/pallets/collator-selection/src/benchmarking.rs b/cumulus/pallets/collator-selection/src/benchmarking.rs index a08b2c7a43..f5467fbd09 100644 --- a/cumulus/pallets/collator-selection/src/benchmarking.rs +++ b/cumulus/pallets/collator-selection/src/benchmarking.rs @@ -44,9 +44,9 @@ macro_rules! whitelist { }; } -fn assert_last_event(generic_event: ::Event) { +fn assert_last_event(generic_event: ::RuntimeEvent) { let events = frame_system::Pallet::::events(); - let system_event: ::Event = generic_event.into(); + let system_event: ::RuntimeEvent = generic_event.into(); // compare to the last event record let EventRecord { event, .. } = &events[events.len() - 1]; assert_eq!(event, &system_event); diff --git a/cumulus/pallets/collator-selection/src/lib.rs b/cumulus/pallets/collator-selection/src/lib.rs index 918ec95a3d..e2e8e95f9a 100644 --- a/cumulus/pallets/collator-selection/src/lib.rs +++ b/cumulus/pallets/collator-selection/src/lib.rs @@ -112,7 +112,7 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// Overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The currency mechanism. type Currency: ReservableCurrency; diff --git a/cumulus/pallets/collator-selection/src/mock.rs b/cumulus/pallets/collator-selection/src/mock.rs index a3aa8a20cc..deac932ac2 100644 --- a/cumulus/pallets/collator-selection/src/mock.rs +++ b/cumulus/pallets/collator-selection/src/mock.rs @@ -60,7 +60,7 @@ impl system::Config for Test { type BlockLength = (); type DbWeight = (); type Origin = Origin; - type Call = Call; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -68,7 +68,7 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -88,7 +88,7 @@ parameter_types! { impl pallet_balances::Config for Test { type Balance = u64; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -171,7 +171,7 @@ parameter_types! { } impl pallet_session::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = IdentityCollator; @@ -207,7 +207,7 @@ impl ValidatorRegistration for IsRegistered { } impl Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = EnsureSignedBy; type PotId = PotId; diff --git a/cumulus/parachain-template/runtime/src/lib.rs b/cumulus/parachain-template/runtime/src/lib.rs index bd56bcac63..aa5b6805c1 100644 --- a/cumulus/parachain-template/runtime/src/lib.rs +++ b/cumulus/parachain-template/runtime/src/lib.rs @@ -104,10 +104,11 @@ pub type SignedExtra = ( ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< @@ -258,7 +259,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -272,7 +273,7 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. type Origin = Origin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). @@ -338,7 +339,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -354,7 +355,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; @@ -368,7 +369,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = XcmpQueue; @@ -384,7 +385,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = (); @@ -395,7 +396,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -407,7 +408,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -439,7 +440,7 @@ parameter_types! { pub type CollatorSelectionUpdateOrigin = EnsureRoot; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -456,7 +457,7 @@ impl pallet_collator_selection::Config for Runtime { /// Configure the pallet template in pallets/template. impl pallet_template::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; } // Create the runtime by composing the FRAME pallets that were previously configured. @@ -613,17 +614,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) diff --git a/cumulus/parachain-template/runtime/src/xcm_config.rs b/cumulus/parachain-template/runtime/src/xcm_config.rs index f01b7166ea..fb2e59bb9a 100644 --- a/cumulus/parachain-template/runtime/src/xcm_config.rs +++ b/cumulus/parachain-template/runtime/src/xcm_config.rs @@ -1,6 +1,6 @@ use super::{ - AccountId, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, - WeightToFee, XcmpQueue, + AccountId, Balances, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, + RuntimeEvent, WeightToFee, XcmpQueue, }; use core::marker::PhantomData; use frame_support::{ @@ -100,9 +100,9 @@ where Deny: ShouldExecute, Allow: ShouldExecute, { - fn should_execute( + fn should_execute( origin: &MultiLocation, - message: &mut Xcm, + message: &mut Xcm, max_weight: XCMWeight, weight_credit: &mut XCMWeight, ) -> Result<(), ()> { @@ -114,9 +114,10 @@ where // See issue #5233 pub struct DenyReserveTransferToRelayChain; impl ShouldExecute for DenyReserveTransferToRelayChain { - fn should_execute( + fn should_execute( origin: &MultiLocation, - message: &mut Xcm, + + message: &mut Xcm, _max_weight: XCMWeight, _weight_credit: &mut XCMWeight, ) -> Result<(), ()> { @@ -163,7 +164,7 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. type AssetTransactor = LocalAssetTransactor; @@ -172,7 +173,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = (); // Teleporting is disabled. type LocationInverter = LocationInverter; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type Trader = UsingComponents>; type ResponseHandler = PolkadotXcm; @@ -194,7 +195,7 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; type ExecuteXcmOrigin = EnsureXcmOrigin; @@ -204,10 +205,10 @@ impl pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; type Origin = Origin; - type Call = Call; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // ^ Override for AdvertisedXcmVersion default @@ -215,6 +216,6 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/cumulus/parachains/common/src/impls.rs b/cumulus/parachains/common/src/impls.rs index 4a2411c2cf..c58e32a67e 100644 --- a/cumulus/parachains/common/src/impls.rs +++ b/cumulus/parachains/common/src/impls.rs @@ -41,7 +41,7 @@ where R: pallet_balances::Config + pallet_collator_selection::Config, AccountIdOf: From + Into, - ::Event: From>, + ::RuntimeEvent: From>, { fn on_nonzero_unbalanced(amount: NegativeImbalance) { let staking_pot = >::account_id(); @@ -57,7 +57,7 @@ where R: pallet_balances::Config + pallet_collator_selection::Config, AccountIdOf: From + Into, - ::Event: From>, + ::RuntimeEvent: From>, { fn on_unbalanceds(mut fees_then_tips: impl Iterator>) { if let Some(mut fees) = fees_then_tips.next() { @@ -156,13 +156,13 @@ mod tests { type Origin = Origin; type Index = u64; type BlockNumber = u64; - type Call = Call; + type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockLength = BlockLength; type BlockWeights = (); @@ -180,7 +180,7 @@ mod tests { impl pallet_balances::Config for Test { type Balance = u64; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = (); type AccountStore = System; @@ -215,7 +215,7 @@ mod tests { } impl pallet_collator_selection::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = EnsureRoot; type PotId = PotId; diff --git a/cumulus/parachains/common/src/xcm_config.rs b/cumulus/parachains/common/src/xcm_config.rs index 7f796666d8..b9ae5ef87c 100644 --- a/cumulus/parachains/common/src/xcm_config.rs +++ b/cumulus/parachains/common/src/xcm_config.rs @@ -22,9 +22,9 @@ where Deny: ShouldExecute, Allow: ShouldExecute, { - fn should_execute( + fn should_execute( origin: &MultiLocation, - message: &mut Xcm, + message: &mut Xcm, max_weight: XCMWeight, weight_credit: &mut XCMWeight, ) -> Result<(), ()> { @@ -36,9 +36,9 @@ where // See issue #5233 pub struct DenyReserveTransferToRelayChain; impl ShouldExecute for DenyReserveTransferToRelayChain { - fn should_execute( + fn should_execute( origin: &MultiLocation, - message: &mut Xcm, + message: &mut Xcm, _max_weight: XCMWeight, _weight_credit: &mut XCMWeight, ) -> Result<(), ()> { diff --git a/cumulus/parachains/pallets/ping/src/lib.rs b/cumulus/parachains/pallets/ping/src/lib.rs index 9d325d9145..5e20a94c07 100644 --- a/cumulus/parachains/pallets/ping/src/lib.rs +++ b/cumulus/parachains/pallets/ping/src/lib.rs @@ -47,13 +47,13 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// The overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; type Origin: From<::Origin> + Into::Origin>>; /// The overarching call type; we assume sibling chains use the same type. - type Call: From> + Encode; + type RuntimeCall: From> + Encode; type XcmSender: SendXcm; } @@ -108,7 +108,7 @@ pub mod pallet { Xcm(vec![Transact { origin_type: OriginKind::Native, require_weight_at_most: 1_000, - call: ::Call::from(Call::::ping { + call: ::RuntimeCall::from(Call::::ping { seq, payload: payload.clone().to_vec(), }) @@ -198,7 +198,7 @@ pub mod pallet { Xcm(vec![Transact { origin_type: OriginKind::Native, require_weight_at_most: 1_000, - call: ::Call::from(Call::::pong { + call: ::RuntimeCall::from(Call::::pong { seq, payload: payload.clone(), }) diff --git a/cumulus/parachains/runtimes/assets/statemine/src/lib.rs b/cumulus/parachains/runtimes/assets/statemine/src/lib.rs index 8de270a645..579eafb82a 100644 --- a/cumulus/parachains/runtimes/assets/statemine/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/statemine/src/lib.rs @@ -129,14 +129,14 @@ impl frame_system::Config for Runtime { type BlockWeights = RuntimeBlockWeights; type BlockLength = RuntimeBlockLength; type AccountId = AccountId; - type Call = Call; + type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Origin = Origin; type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; @@ -185,7 +185,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -201,7 +201,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = WeightToFee; @@ -227,7 +227,7 @@ pub type AssetsForceOrigin = EitherOfDiverse, EnsureXcm>>; impl pallet_assets::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetId; type Currency = Balances; @@ -252,8 +252,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -262,8 +262,8 @@ impl pallet_multisig::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -315,65 +315,75 @@ impl Default for ProxyType { Self::Any } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, - ProxyType::NonTransfer => - !matches!(c, Call::Balances { .. } | Call::Assets { .. } | Call::Uniques { .. }), + ProxyType::NonTransfer => !matches!( + c, + RuntimeCall::Balances { .. } | + RuntimeCall::Assets { .. } | + RuntimeCall::Uniques { .. } + ), ProxyType::CancelProxy => matches!( c, - Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Assets => { matches!( c, - Call::Assets { .. } | - Call::Utility { .. } | Call::Multisig { .. } | - Call::Uniques { .. } + RuntimeCall::Assets { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } | + RuntimeCall::Uniques { .. } ) }, ProxyType::AssetOwner => matches!( c, - Call::Assets(pallet_assets::Call::create { .. }) | - Call::Assets(pallet_assets::Call::destroy { .. }) | - Call::Assets(pallet_assets::Call::transfer_ownership { .. }) | - Call::Assets(pallet_assets::Call::set_team { .. }) | - Call::Assets(pallet_assets::Call::set_metadata { .. }) | - Call::Assets(pallet_assets::Call::clear_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::create { .. }) | - Call::Uniques(pallet_uniques::Call::destroy { .. }) | - Call::Uniques(pallet_uniques::Call::transfer_ownership { .. }) | - Call::Uniques(pallet_uniques::Call::set_team { .. }) | - Call::Uniques(pallet_uniques::Call::set_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::set_attribute { .. }) | - Call::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::clear_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::clear_attribute { .. }) | - Call::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Assets(pallet_assets::Call::create { .. }) | + RuntimeCall::Assets(pallet_assets::Call::destroy { .. }) | + RuntimeCall::Assets(pallet_assets::Call::transfer_ownership { .. }) | + RuntimeCall::Assets(pallet_assets::Call::set_team { .. }) | + RuntimeCall::Assets(pallet_assets::Call::set_metadata { .. }) | + RuntimeCall::Assets(pallet_assets::Call::clear_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::create { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::destroy { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::transfer_ownership { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_team { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_attribute { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_attribute { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::AssetManager => matches!( c, - Call::Assets(pallet_assets::Call::mint { .. }) | - Call::Assets(pallet_assets::Call::burn { .. }) | - Call::Assets(pallet_assets::Call::freeze { .. }) | - Call::Assets(pallet_assets::Call::thaw { .. }) | - Call::Assets(pallet_assets::Call::freeze_asset { .. }) | - Call::Assets(pallet_assets::Call::thaw_asset { .. }) | - Call::Uniques(pallet_uniques::Call::mint { .. }) | - Call::Uniques(pallet_uniques::Call::burn { .. }) | - Call::Uniques(pallet_uniques::Call::freeze { .. }) | - Call::Uniques(pallet_uniques::Call::thaw { .. }) | - Call::Uniques(pallet_uniques::Call::freeze_collection { .. }) | - Call::Uniques(pallet_uniques::Call::thaw_collection { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Assets(pallet_assets::Call::mint { .. }) | + RuntimeCall::Assets(pallet_assets::Call::burn { .. }) | + RuntimeCall::Assets(pallet_assets::Call::freeze { .. }) | + RuntimeCall::Assets(pallet_assets::Call::thaw { .. }) | + RuntimeCall::Assets(pallet_assets::Call::freeze_asset { .. }) | + RuntimeCall::Assets(pallet_assets::Call::thaw_asset { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::mint { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::burn { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::freeze { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::thaw { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::freeze_collection { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::thaw_collection { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Collator => matches!( c, - Call::CollatorSelection { .. } | Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::CollatorSelection { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), } } @@ -392,8 +402,8 @@ impl InstanceFilter for ProxyType { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = ProxyDepositBase; @@ -412,7 +422,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; @@ -428,7 +438,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -442,7 +452,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -454,7 +464,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -486,7 +496,7 @@ pub type CollatorSelectionUpdateOrigin = EitherOfDiverse, EnsureXcm>>; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -502,7 +512,7 @@ impl pallet_collator_selection::Config for Runtime { } impl pallet_asset_tx_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Fungibles = Assets; type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter< pallet_assets::BalanceToAssetBalance, @@ -522,7 +532,7 @@ parameter_types! { } impl pallet_uniques::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type CollectionId = u32; type ItemId = u32; type Currency = Balances; @@ -607,9 +617,10 @@ pub type SignedExtra = ( pallet_asset_tx_payment::ChargeAssetTxPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -746,17 +757,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) @@ -889,7 +900,7 @@ impl_runtime_apis! { } impl pallet_xcm_benchmarks::generic::Config for Runtime { - type Call = Call; + type RuntimeCall = RuntimeCall; fn worst_case_response() -> (u64, Response) { (0u64, Response::Version(Default::default())) diff --git a/cumulus/parachains/runtimes/assets/statemine/src/xcm_config.rs b/cumulus/parachains/runtimes/assets/statemine/src/xcm_config.rs index d8f59ffcb6..5036b889c1 100644 --- a/cumulus/parachains/runtimes/assets/statemine/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/assets/statemine/src/xcm_config.rs @@ -14,8 +14,8 @@ // limitations under the License. use super::{ - AccountId, AssetId, Assets, Authorship, Balance, Balances, Call, Event, Origin, ParachainInfo, - ParachainSystem, PolkadotXcm, Runtime, WeightToFee, XcmpQueue, + AccountId, AssetId, Assets, Authorship, Balance, Balances, Origin, ParachainInfo, + ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, @@ -159,7 +159,7 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; type AssetTransactor = AssetTransactors; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -170,8 +170,11 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of KSM type LocationInverter = LocationInverter; type Barrier = Barrier; - type Weigher = - WeightInfoBounds, Call, MaxInstructions>; + type Weigher = WeightInfoBounds< + crate::weights::xcm::StatemineXcmWeight, + RuntimeCall, + MaxInstructions, + >; type Trader = ( UsingComponents>, cumulus_primitives_utility::TakeFirstAssetTrader< @@ -215,7 +218,7 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; // We want to disallow users sending (arbitrary) XCMs from this chain. type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; @@ -226,17 +229,20 @@ impl pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = - WeightInfoBounds, Call, MaxInstructions>; + type Weigher = WeightInfoBounds< + crate::weights::xcm::StatemineXcmWeight, + RuntimeCall, + MaxInstructions, + >; type LocationInverter = LocationInverter; type Origin = Origin; - type Call = Call; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/cumulus/parachains/runtimes/assets/statemint/src/lib.rs b/cumulus/parachains/runtimes/assets/statemint/src/lib.rs index 02a04b3ed0..5a54fa95cc 100644 --- a/cumulus/parachains/runtimes/assets/statemint/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/statemint/src/lib.rs @@ -159,14 +159,14 @@ impl frame_system::Config for Runtime { type BlockWeights = RuntimeBlockWeights; type BlockLength = RuntimeBlockLength; type AccountId = AccountId; - type Call = Call; + type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Origin = Origin; type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; @@ -215,7 +215,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -231,7 +231,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = WeightToFee; @@ -257,7 +257,7 @@ pub type AssetsForceOrigin = EitherOfDiverse, EnsureXcm>>; impl pallet_assets::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetId; type Currency = Balances; @@ -282,8 +282,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -292,8 +292,8 @@ impl pallet_multisig::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -345,65 +345,75 @@ impl Default for ProxyType { Self::Any } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, - ProxyType::NonTransfer => - !matches!(c, Call::Balances { .. } | Call::Assets { .. } | Call::Uniques { .. }), + ProxyType::NonTransfer => !matches!( + c, + RuntimeCall::Balances { .. } | + RuntimeCall::Assets { .. } | + RuntimeCall::Uniques { .. } + ), ProxyType::CancelProxy => matches!( c, - Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Assets => { matches!( c, - Call::Assets { .. } | - Call::Utility { .. } | Call::Multisig { .. } | - Call::Uniques { .. } + RuntimeCall::Assets { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } | + RuntimeCall::Uniques { .. } ) }, ProxyType::AssetOwner => matches!( c, - Call::Assets(pallet_assets::Call::create { .. }) | - Call::Assets(pallet_assets::Call::destroy { .. }) | - Call::Assets(pallet_assets::Call::transfer_ownership { .. }) | - Call::Assets(pallet_assets::Call::set_team { .. }) | - Call::Assets(pallet_assets::Call::set_metadata { .. }) | - Call::Assets(pallet_assets::Call::clear_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::create { .. }) | - Call::Uniques(pallet_uniques::Call::destroy { .. }) | - Call::Uniques(pallet_uniques::Call::transfer_ownership { .. }) | - Call::Uniques(pallet_uniques::Call::set_team { .. }) | - Call::Uniques(pallet_uniques::Call::set_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::set_attribute { .. }) | - Call::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::clear_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::clear_attribute { .. }) | - Call::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Assets(pallet_assets::Call::create { .. }) | + RuntimeCall::Assets(pallet_assets::Call::destroy { .. }) | + RuntimeCall::Assets(pallet_assets::Call::transfer_ownership { .. }) | + RuntimeCall::Assets(pallet_assets::Call::set_team { .. }) | + RuntimeCall::Assets(pallet_assets::Call::set_metadata { .. }) | + RuntimeCall::Assets(pallet_assets::Call::clear_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::create { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::destroy { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::transfer_ownership { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_team { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_attribute { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_attribute { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::AssetManager => matches!( c, - Call::Assets(pallet_assets::Call::mint { .. }) | - Call::Assets(pallet_assets::Call::burn { .. }) | - Call::Assets(pallet_assets::Call::freeze { .. }) | - Call::Assets(pallet_assets::Call::thaw { .. }) | - Call::Assets(pallet_assets::Call::freeze_asset { .. }) | - Call::Assets(pallet_assets::Call::thaw_asset { .. }) | - Call::Uniques(pallet_uniques::Call::mint { .. }) | - Call::Uniques(pallet_uniques::Call::burn { .. }) | - Call::Uniques(pallet_uniques::Call::freeze { .. }) | - Call::Uniques(pallet_uniques::Call::thaw { .. }) | - Call::Uniques(pallet_uniques::Call::freeze_collection { .. }) | - Call::Uniques(pallet_uniques::Call::thaw_collection { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Assets(pallet_assets::Call::mint { .. }) | + RuntimeCall::Assets(pallet_assets::Call::burn { .. }) | + RuntimeCall::Assets(pallet_assets::Call::freeze { .. }) | + RuntimeCall::Assets(pallet_assets::Call::thaw { .. }) | + RuntimeCall::Assets(pallet_assets::Call::freeze_asset { .. }) | + RuntimeCall::Assets(pallet_assets::Call::thaw_asset { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::mint { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::burn { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::freeze { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::thaw { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::freeze_collection { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::thaw_collection { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Collator => matches!( c, - Call::CollatorSelection { .. } | Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::CollatorSelection { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), } } @@ -422,8 +432,8 @@ impl InstanceFilter for ProxyType { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = ProxyDepositBase; @@ -442,7 +452,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; @@ -458,7 +468,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -472,7 +482,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -484,7 +494,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -516,7 +526,7 @@ pub type CollatorSelectionUpdateOrigin = EitherOfDiverse, EnsureXcm>>; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -532,7 +542,7 @@ impl pallet_collator_selection::Config for Runtime { } impl pallet_asset_tx_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Fungibles = Assets; type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter< pallet_assets::BalanceToAssetBalance, @@ -552,7 +562,7 @@ parameter_types! { } impl pallet_uniques::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type CollectionId = u32; type ItemId = u32; type Currency = Balances; @@ -637,9 +647,10 @@ pub type SignedExtra = ( pallet_asset_tx_payment::ChargeAssetTxPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -775,17 +786,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) @@ -917,7 +928,7 @@ impl_runtime_apis! { } impl pallet_xcm_benchmarks::generic::Config for Runtime { - type Call = Call; + type RuntimeCall = RuntimeCall; fn worst_case_response() -> (u64, Response) { (0u64, Response::Version(Default::default())) diff --git a/cumulus/parachains/runtimes/assets/statemint/src/xcm_config.rs b/cumulus/parachains/runtimes/assets/statemint/src/xcm_config.rs index a8bf77b6d3..a7932e69de 100644 --- a/cumulus/parachains/runtimes/assets/statemint/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/assets/statemint/src/xcm_config.rs @@ -14,8 +14,8 @@ // limitations under the License. use super::{ - AccountId, AssetId, Assets, Authorship, Balance, Balances, Call, Event, Origin, ParachainInfo, - ParachainSystem, PolkadotXcm, Runtime, WeightToFee, XcmpQueue, + AccountId, AssetId, Assets, Authorship, Balance, Balances, Origin, ParachainInfo, + ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, @@ -156,7 +156,7 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; type AssetTransactor = AssetTransactors; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -167,8 +167,11 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of DOT type LocationInverter = LocationInverter; type Barrier = Barrier; - type Weigher = - WeightInfoBounds, Call, MaxInstructions>; + type Weigher = WeightInfoBounds< + crate::weights::xcm::StatemintXcmWeight, + RuntimeCall, + MaxInstructions, + >; type Trader = UsingComponents>; type ResponseHandler = PolkadotXcm; @@ -191,7 +194,7 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; // We want to disallow users sending (arbitrary) XCMs from this chain. type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; @@ -202,16 +205,19 @@ impl pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = - WeightInfoBounds, Call, MaxInstructions>; + type Weigher = WeightInfoBounds< + crate::weights::xcm::StatemintXcmWeight, + RuntimeCall, + MaxInstructions, + >; type LocationInverter = LocationInverter; type Origin = Origin; - type Call = Call; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/cumulus/parachains/runtimes/assets/westmint/src/lib.rs b/cumulus/parachains/runtimes/assets/westmint/src/lib.rs index 6482e5a1b0..27e6c15da0 100644 --- a/cumulus/parachains/runtimes/assets/westmint/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/westmint/src/lib.rs @@ -127,14 +127,14 @@ impl frame_system::Config for Runtime { type BlockWeights = RuntimeBlockWeights; type BlockLength = RuntimeBlockLength; type AccountId = AccountId; - type Call = Call; + type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Origin = Origin; type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; @@ -183,7 +183,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -199,7 +199,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = WeightToFee; @@ -222,7 +222,7 @@ parameter_types! { pub type AssetsForceOrigin = EnsureRoot; impl pallet_assets::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetId; type Currency = Balances; @@ -247,8 +247,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -257,8 +257,8 @@ impl pallet_multisig::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -310,65 +310,75 @@ impl Default for ProxyType { Self::Any } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, - ProxyType::NonTransfer => - !matches!(c, Call::Balances { .. } | Call::Assets { .. } | Call::Uniques { .. }), + ProxyType::NonTransfer => !matches!( + c, + RuntimeCall::Balances { .. } | + RuntimeCall::Assets { .. } | + RuntimeCall::Uniques { .. } + ), ProxyType::CancelProxy => matches!( c, - Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Assets => { matches!( c, - Call::Assets { .. } | - Call::Utility { .. } | Call::Multisig { .. } | - Call::Uniques { .. } + RuntimeCall::Assets { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } | + RuntimeCall::Uniques { .. } ) }, ProxyType::AssetOwner => matches!( c, - Call::Assets(pallet_assets::Call::create { .. }) | - Call::Assets(pallet_assets::Call::destroy { .. }) | - Call::Assets(pallet_assets::Call::transfer_ownership { .. }) | - Call::Assets(pallet_assets::Call::set_team { .. }) | - Call::Assets(pallet_assets::Call::set_metadata { .. }) | - Call::Assets(pallet_assets::Call::clear_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::create { .. }) | - Call::Uniques(pallet_uniques::Call::destroy { .. }) | - Call::Uniques(pallet_uniques::Call::transfer_ownership { .. }) | - Call::Uniques(pallet_uniques::Call::set_team { .. }) | - Call::Uniques(pallet_uniques::Call::set_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::set_attribute { .. }) | - Call::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::clear_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::clear_attribute { .. }) | - Call::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) | - Call::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Assets(pallet_assets::Call::create { .. }) | + RuntimeCall::Assets(pallet_assets::Call::destroy { .. }) | + RuntimeCall::Assets(pallet_assets::Call::transfer_ownership { .. }) | + RuntimeCall::Assets(pallet_assets::Call::set_team { .. }) | + RuntimeCall::Assets(pallet_assets::Call::set_metadata { .. }) | + RuntimeCall::Assets(pallet_assets::Call::clear_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::create { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::destroy { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::transfer_ownership { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_team { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_attribute { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_attribute { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::AssetManager => matches!( c, - Call::Assets(pallet_assets::Call::mint { .. }) | - Call::Assets(pallet_assets::Call::burn { .. }) | - Call::Assets(pallet_assets::Call::freeze { .. }) | - Call::Assets(pallet_assets::Call::thaw { .. }) | - Call::Assets(pallet_assets::Call::freeze_asset { .. }) | - Call::Assets(pallet_assets::Call::thaw_asset { .. }) | - Call::Uniques(pallet_uniques::Call::mint { .. }) | - Call::Uniques(pallet_uniques::Call::burn { .. }) | - Call::Uniques(pallet_uniques::Call::freeze { .. }) | - Call::Uniques(pallet_uniques::Call::thaw { .. }) | - Call::Uniques(pallet_uniques::Call::freeze_collection { .. }) | - Call::Uniques(pallet_uniques::Call::thaw_collection { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Assets(pallet_assets::Call::mint { .. }) | + RuntimeCall::Assets(pallet_assets::Call::burn { .. }) | + RuntimeCall::Assets(pallet_assets::Call::freeze { .. }) | + RuntimeCall::Assets(pallet_assets::Call::thaw { .. }) | + RuntimeCall::Assets(pallet_assets::Call::freeze_asset { .. }) | + RuntimeCall::Assets(pallet_assets::Call::thaw_asset { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::mint { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::burn { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::freeze { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::thaw { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::freeze_collection { .. }) | + RuntimeCall::Uniques(pallet_uniques::Call::thaw_collection { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Collator => matches!( c, - Call::CollatorSelection { .. } | Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::CollatorSelection { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), } } @@ -387,8 +397,8 @@ impl InstanceFilter for ProxyType { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = ProxyDepositBase; @@ -407,7 +417,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = XcmpQueue; @@ -423,7 +433,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -434,7 +444,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -446,7 +456,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -476,7 +486,7 @@ parameter_types! { pub type CollatorSelectionUpdateOrigin = EnsureRoot; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -492,7 +502,7 @@ impl pallet_collator_selection::Config for Runtime { } impl pallet_asset_tx_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Fungibles = Assets; type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter< pallet_assets::BalanceToAssetBalance, @@ -512,7 +522,7 @@ parameter_types! { } impl pallet_uniques::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type CollectionId = u32; type ItemId = u32; type Currency = Balances; @@ -597,9 +607,10 @@ pub type SignedExtra = ( pallet_asset_tx_payment::ChargeAssetTxPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -736,17 +747,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) @@ -878,7 +889,7 @@ impl_runtime_apis! { } impl pallet_xcm_benchmarks::generic::Config for Runtime { - type Call = Call; + type RuntimeCall = RuntimeCall; fn worst_case_response() -> (u64, Response) { (0u64, Response::Version(Default::default())) diff --git a/cumulus/parachains/runtimes/assets/westmint/src/xcm_config.rs b/cumulus/parachains/runtimes/assets/westmint/src/xcm_config.rs index 94a6ba6528..bd869c977b 100644 --- a/cumulus/parachains/runtimes/assets/westmint/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/assets/westmint/src/xcm_config.rs @@ -14,8 +14,8 @@ // limitations under the License. use super::{ - AccountId, AssetId, Assets, Authorship, Balance, Balances, Call, Event, Origin, ParachainInfo, - ParachainSystem, PolkadotXcm, Runtime, WeightToFee, XcmpQueue, + AccountId, AssetId, Assets, Authorship, Balance, Balances, Origin, ParachainInfo, + ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, @@ -156,7 +156,7 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; type AssetTransactor = AssetTransactors; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -167,8 +167,11 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of WND type LocationInverter = LocationInverter; type Barrier = Barrier; - type Weigher = - WeightInfoBounds, Call, MaxInstructions>; + type Weigher = WeightInfoBounds< + crate::weights::xcm::WestmintXcmWeight, + RuntimeCall, + MaxInstructions, + >; type Trader = ( UsingComponents>, cumulus_primitives_utility::TakeFirstAssetTrader< @@ -211,7 +214,7 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; type ExecuteXcmOrigin = EnsureXcmOrigin; @@ -219,16 +222,19 @@ impl pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = - WeightInfoBounds, Call, MaxInstructions>; + type Weigher = WeightInfoBounds< + crate::weights::xcm::WestmintXcmWeight, + RuntimeCall, + MaxInstructions, + >; type LocationInverter = LocationInverter; type Origin = Origin; - type Call = Call; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index cd7701481c..a5c5a5daf6 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -152,14 +152,14 @@ impl frame_system::Config for Runtime { type BlockWeights = RuntimeBlockWeights; type BlockLength = RuntimeBlockLength; type AccountId = AccountId; - type Call = Call; + type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Origin = Origin; type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; @@ -200,7 +200,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -215,7 +215,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = WeightToFee; @@ -232,8 +232,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -242,8 +242,8 @@ impl pallet_multisig::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } @@ -289,25 +289,29 @@ impl Default for ProxyType { Self::Any } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, - ProxyType::NonTransfer => !matches!(c, Call::Balances { .. }), + ProxyType::NonTransfer => !matches!(c, RuntimeCall::Balances { .. }), ProxyType::CancelProxy => matches!( c, - Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Collator => matches!( c, - Call::CollatorSelection { .. } | Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::CollatorSelection { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), ProxyType::Alliance => matches!( c, - Call::AllianceMotion { .. } | - Call::Alliance { .. } | - Call::Utility { .. } | Call::Multisig { .. } + RuntimeCall::AllianceMotion { .. } | + RuntimeCall::Alliance { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } ), } } @@ -323,8 +327,8 @@ impl InstanceFilter for ProxyType { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = ProxyDepositBase; @@ -343,7 +347,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; @@ -359,7 +363,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -370,7 +374,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -379,7 +383,7 @@ pub const PERIOD: u32 = 6 * HOURS; pub const OFFSET: u32 = 0; impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -408,7 +412,7 @@ parameter_types! { pub type CollatorSelectionUpdateOrigin = RootOrExecutiveSimpleMajority; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -434,8 +438,8 @@ pub const ALLIANCE_MAX_MEMBERS: u32 = 100; type AllianceCollective = pallet_collective::Instance1; impl pallet_collective::Config for Runtime { type Origin = Origin; - type Proposal = Call; - type Event = Event; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type MotionDuration = AllianceMotionDuration; type MaxProposals = ConstU32; type MaxMembers = ConstU32; @@ -458,8 +462,8 @@ parameter_types! { } impl pallet_alliance::Config for Runtime { - type Event = Event; - type Proposal = Call; + type RuntimeEvent = RuntimeEvent; + type Proposal = RuntimeCall; type AdminOrigin = RootOrAllianceTwoThirdsMajority; type MembershipManager = RootOrAllianceTwoThirdsMajority; type AnnouncementOrigin = RootOrAllianceTwoThirdsMajority; @@ -544,9 +548,10 @@ pub type SignedExtra = ( frame_system::CheckWeight, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs index f728a6d9cb..bfcfd9567b 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs @@ -14,8 +14,8 @@ // limitations under the License. use super::{ - AccountId, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, - WeightToFee, XcmpQueue, + AccountId, Balances, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, + RuntimeEvent, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, @@ -132,7 +132,7 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; type AssetTransactor = CurrencyTransactor; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -143,7 +143,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = ConcreteNativeAssetFrom; type LocationInverter = LocationInverter; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type Trader = UsingComponents>; type ResponseHandler = PolkadotXcm; @@ -166,7 +166,7 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; // We want to disallow users sending (arbitrary) XCMs from this chain. type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; @@ -177,15 +177,15 @@ impl pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location. - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; type Origin = Origin; - type Call = Call; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs index 5f3d5310b8..3c4e81f3e3 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs @@ -1,6 +1,6 @@ use crate::{ - constants::currency::deposit, Balance, Balances, Call, Event, RandomnessCollectiveFlip, - Runtime, RuntimeBlockWeights, Timestamp, + constants::currency::deposit, Balance, Balances, RandomnessCollectiveFlip, Runtime, + RuntimeBlockWeights, RuntimeCall, RuntimeEvent, Timestamp, }; use frame_support::{ parameter_types, @@ -37,8 +37,8 @@ impl Config for Runtime { type Time = Timestamp; type Randomness = RandomnessCollectiveFlip; type Currency = Balances; - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; /// The safest default is to allow no calls at all. /// /// Runtimes should whitelist dispatchables that are allowed to be called from contracts diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index ff0271775b..46c53a95ef 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -89,9 +89,10 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -156,14 +157,14 @@ impl frame_system::Config for Runtime { type BlockWeights = RuntimeBlockWeights; type BlockLength = RuntimeBlockLength; type AccountId = AccountId; - type Call = Call; + type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Origin = Origin; type BlockHashCount = BlockHashCount; type DbWeight = RocksDbWeight; @@ -198,7 +199,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ConstU128; type AccountStore = System; @@ -208,7 +209,7 @@ impl pallet_balances::Config for Runtime { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter>; type WeightToFee = WeightToFee; @@ -226,8 +227,8 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -236,8 +237,8 @@ impl pallet_multisig::Config for Runtime { } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = pallet_utility::weights::SubstrateWeight; } @@ -248,7 +249,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; @@ -271,7 +272,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -295,7 +296,7 @@ parameter_types! { } impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -311,8 +312,8 @@ impl pallet_collator_selection::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Call = Call; - type Event = Event; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; } // Create the runtime by composing the FRAME pallets that were previously configured. @@ -479,17 +480,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs index 97a2991525..fbccf508c1 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs @@ -14,8 +14,8 @@ // limitations under the License. use super::{ - AccountId, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, - WeightToFee, XcmpQueue, + AccountId, Balances, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, + RuntimeEvent, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, @@ -135,7 +135,7 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; type AssetTransactor = CurrencyTransactor; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -143,7 +143,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = NativeAsset; type LocationInverter = LocationInverter; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type Trader = UsingComponents; type ResponseHandler = PolkadotXcm; type AssetTrap = PolkadotXcm; @@ -165,7 +165,7 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; // We want to disallow users sending (arbitrary) XCMs from this chain. type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; @@ -176,21 +176,21 @@ impl pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; type Origin = Origin; - type Call = Call; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -204,7 +204,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } diff --git a/cumulus/parachains/runtimes/starters/seedling/src/lib.rs b/cumulus/parachains/runtimes/starters/seedling/src/lib.rs index 8c34141c33..035dff2eb4 100644 --- a/cumulus/parachains/runtimes/starters/seedling/src/lib.rs +++ b/cumulus/parachains/runtimes/starters/seedling/src/lib.rs @@ -114,7 +114,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -128,7 +128,7 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. type Origin = Origin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). @@ -151,16 +151,16 @@ impl frame_system::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Call = Call; - type Event = Event; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; } impl cumulus_pallet_solo_to_para::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = cumulus_pallet_solo_to_para::Pallet; type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = (); @@ -216,9 +216,10 @@ pub type SignedExtra = ( cumulus_pallet_solo_to_para::CheckSudo, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, diff --git a/cumulus/parachains/runtimes/starters/shell/src/lib.rs b/cumulus/parachains/runtimes/starters/shell/src/lib.rs index 31a95e20d9..fab27c2fc6 100644 --- a/cumulus/parachains/runtimes/starters/shell/src/lib.rs +++ b/cumulus/parachains/runtimes/starters/shell/src/lib.rs @@ -122,7 +122,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -136,7 +136,7 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. type Origin = Origin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). @@ -164,7 +164,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = (); @@ -200,7 +200,7 @@ pub struct DisallowSigned; impl sp_runtime::traits::SignedExtension for DisallowSigned { const IDENTIFIER: &'static str = "DisallowSigned"; type AccountId = AccountId; - type Call = Call; + type Call = RuntimeCall; type AdditionalSigned = (); type Pre = (); fn additional_signed( @@ -248,9 +248,10 @@ pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = DisallowSigned; /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, diff --git a/cumulus/parachains/runtimes/starters/shell/src/xcm_config.rs b/cumulus/parachains/runtimes/starters/shell/src/xcm_config.rs index e5d96c7a64..8e754299ab 100644 --- a/cumulus/parachains/runtimes/starters/shell/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/starters/shell/src/xcm_config.rs @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use super::{AccountId, Call, Event, Origin, ParachainInfo, Runtime}; +use super::{AccountId, Origin, ParachainInfo, Runtime, RuntimeCall, RuntimeEvent}; use frame_support::{match_types, parameter_types}; use xcm::latest::prelude::*; use xcm_builder::{ @@ -52,7 +52,7 @@ parameter_types! { pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = (); // sending XCM not supported type AssetTransactor = (); // balances not supported type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -60,7 +60,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = (); // balances not supported type LocationInverter = LocationInverter; type Barrier = AllowUnpaidExecutionFrom; - type Weigher = FixedWeightBounds; // balances not supported + type Weigher = FixedWeightBounds; // balances not supported type Trader = (); // balances not supported type ResponseHandler = (); // Don't handle responses for now. type AssetTrap = (); // don't trap for now @@ -69,6 +69,6 @@ impl xcm_executor::Config for XcmConfig { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = xcm_executor::XcmExecutor; } diff --git a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs index ba91d29aa7..a9342c3a65 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs @@ -117,10 +117,11 @@ pub type SignedExtra = ( ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< @@ -271,7 +272,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -285,7 +286,7 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. type Origin = Origin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). @@ -351,7 +352,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -367,7 +368,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; @@ -389,7 +390,7 @@ parameter_types! { // EnsureOneOf, EnsureXcm>>; impl pallet_assets::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetId; type Currency = Balances; @@ -411,7 +412,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type DmpMessageHandler = DmpQueue; @@ -427,7 +428,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; @@ -438,7 +439,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -450,7 +451,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pallet_collator_selection::IdentityCollator; @@ -482,7 +483,7 @@ parameter_types! { pub type CollatorSelectionUpdateOrigin = EnsureRoot; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; @@ -498,7 +499,7 @@ impl pallet_collator_selection::Config for Runtime { } impl pallet_asset_tx_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Fungibles = Assets; type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter< pallet_assets::BalanceToAssetBalance, @@ -507,8 +508,8 @@ impl pallet_asset_tx_payment::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; } // Create the runtime by composing the FRAME pallets that were previously configured. @@ -668,17 +669,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) diff --git a/cumulus/parachains/runtimes/testing/penpal/src/xcm_config.rs b/cumulus/parachains/runtimes/testing/penpal/src/xcm_config.rs index b132659a29..5c814be50c 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/xcm_config.rs @@ -22,8 +22,8 @@ //! with statemine as the reserve. At present no derivative tokens are minted on receipt of a //! ReserveAssetTransferDeposited message but that will but the intension will be to support this soon. use super::{ - AccountId, AssetId as AssetIdPalletAssets, Assets, Balance, Balances, Call, Event, Origin, - ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, WeightToFee, XcmpQueue, + AccountId, AssetId as AssetIdPalletAssets, Assets, Balance, Balances, Origin, ParachainInfo, + ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, WeightToFee, XcmpQueue, }; use core::marker::PhantomData; use frame_support::{ @@ -161,9 +161,9 @@ where Deny: ShouldExecute, Allow: ShouldExecute, { - fn should_execute( + fn should_execute( origin: &MultiLocation, - message: &mut Xcm, + message: &mut Xcm, max_weight: XCMWeight, weight_credit: &mut XCMWeight, ) -> Result<(), ()> { @@ -175,9 +175,9 @@ where // See issue #5233 pub struct DenyReserveTransferToRelayChain; impl ShouldExecute for DenyReserveTransferToRelayChain { - fn should_execute( + fn should_execute( origin: &MultiLocation, - message: &mut Xcm, + message: &mut Xcm, _max_weight: XCMWeight, _weight_credit: &mut XCMWeight, ) -> Result<(), ()> { @@ -320,7 +320,7 @@ pub type Reserves = (NativeAsset, AssetsFrom); pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. type AssetTransactor = AssetTransactors; @@ -329,7 +329,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = NativeAsset; type LocationInverter = LocationInverter; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type Trader = UsingComponents>; type ResponseHandler = PolkadotXcm; @@ -351,7 +351,7 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; type ExecuteXcmOrigin = EnsureXcmOrigin; @@ -361,10 +361,10 @@ impl pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; type Origin = Origin; - type Call = Call; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // ^ Override for AdvertisedXcmVersion default @@ -372,6 +372,6 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs index 6606e46570..96ba3bdef2 100644 --- a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -164,7 +164,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. @@ -178,7 +178,7 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. type Origin = Origin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). @@ -225,7 +225,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -240,7 +240,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type WeightToFee = IdentityFee; type LengthToFee = ConstantMultiplier; @@ -249,8 +249,8 @@ impl pallet_transaction_payment::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Call = Call; - type Event = Event; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; } parameter_types! { @@ -259,7 +259,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = XcmpQueue; @@ -398,7 +398,7 @@ pub type Reserves = (NativeAsset, AssetsFrom); pub struct XcmConfig; impl Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. type AssetTransactor = AssetTransactors; @@ -407,7 +407,7 @@ impl Config for XcmConfig { type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of ROC type LocationInverter = LocationInverter; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type Trader = UsingComponents, RocLocation, AccountId, Balances, ()>; type ResponseHandler = PolkadotXcm; type AssetTrap = PolkadotXcm; @@ -428,7 +428,7 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; type ExecuteXcmOrigin = EnsureXcmOrigin; @@ -436,21 +436,21 @@ impl pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = frame_support::traits::Nothing; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; type Origin = Origin; - type Call = Call; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = (); @@ -461,15 +461,15 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = frame_system::EnsureRoot; } impl cumulus_ping::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Origin = Origin; - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; } @@ -489,7 +489,7 @@ pub type AdminOrigin = EitherOfDiverse, EnsureXcm>>; impl pallet_assets::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = u64; type AssetId = AssetId; type Currency = Balances; @@ -573,9 +573,10 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -697,17 +698,17 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) diff --git a/cumulus/test/runtime/src/lib.rs b/cumulus/test/runtime/src/lib.rs index 225b874f36..0d5838d001 100644 --- a/cumulus/test/runtime/src/lib.rs +++ b/cumulus/test/runtime/src/lib.rs @@ -170,7 +170,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = IdentityLookup; /// The index type for storing how many extrinsics an account has signed. @@ -184,7 +184,7 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. type Origin = Origin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). @@ -229,7 +229,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -244,7 +244,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type WeightToFee = IdentityFee; type LengthToFee = ConstantMultiplier; @@ -253,13 +253,13 @@ impl pallet_transaction_payment::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Call = Call; - type Event = Event; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; } impl cumulus_pallet_parachain_system::Config for Runtime { type SelfParaId = ParachainId; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type OutboundXcmpMessageSource = (); type DmpMessageHandler = (); @@ -328,9 +328,10 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -341,7 +342,7 @@ pub type Executive = frame_executive::Executive< TestOnRuntimeUpgrade, >; /// The payload being signed in transactions. -pub type SignedPayload = generic::SignedPayload; +pub type SignedPayload = generic::SignedPayload; pub struct TestOnRuntimeUpgrade;