Companion for #11981 (#5915)

* Companion for #11981

* more renaming

* fmt

* fixes

* add generic type

* Companion for #11831

* fix

* revert changes

* Delete rename-outer-enum.diff

* revert

* Update run_benches_for_runtime.sh

* rename type Call & type Event

* passing tests

* fmt

* small fixes

* commit

* fix

* fmt

* commit

* error fixes

* fix

* small fix in test

* Update lib.rs

* Update lib.rs

* Update lib.rs

* Update lib.rs

* Update lib.rs

* Update lib.rs

* Update lib.rs

* remove RuntimeCall from pallet_grandpa

* last fix

* commit

* rename

* merge fix

* update lockfile for {"substrate"}

* cargo +nightly fmt

* fix

Co-authored-by: parity-processbot <>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Sergej Sakac
2022-09-13 01:03:47 +02:00
committed by GitHub
parent db0fc60344
commit 8ea6076fe5
73 changed files with 1241 additions and 1151 deletions
@@ -85,7 +85,7 @@ pub mod pallet {
#[pallet::disable_frame_system_supertrait_check]
pub trait Config: configuration::Config + paras::Config + slots::Config {
/// The overarching event type.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// Origin for assigning slots.
type AssignSlotOrigin: EnsureOrigin<<Self as frame_system::Config>::Origin>;
@@ -579,10 +579,10 @@ mod tests {
impl<C> frame_system::offchain::SendTransactionTypes<C> for Test
where
Call: From<C>,
RuntimeCall: From<C>,
{
type Extrinsic = UncheckedExtrinsic;
type OverarchingCall = Call;
type OverarchingCall = RuntimeCall;
}
parameter_types! {
@@ -593,7 +593,7 @@ mod tests {
type BlockWeights = ();
type BlockLength = ();
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = BlockNumber;
type Hash = H256;
@@ -601,7 +601,7 @@ mod tests {
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type DbWeight = ();
type Version = ();
@@ -621,7 +621,7 @@ mod tests {
impl pallet_balances::Config for Test {
type Balance = u64;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
@@ -640,7 +640,7 @@ mod tests {
}
impl parachains_paras::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = parachains_paras::TestWeightInfo;
type UnsignedPriority = ParasUnsignedPriority;
type NextSessionRotation = crate::mock::TestNextSessionRotation;
@@ -655,7 +655,7 @@ mod tests {
}
impl slots::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type Registrar = TestRegistrar<Test>;
type LeasePeriod = LeasePeriod;
@@ -673,7 +673,7 @@ mod tests {
}
impl assigned_slots::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type AssignSlotOrigin = EnsureRoot<Self::AccountId>;
type Leaser = Slots;
type PermanentSlotLeasePeriodLength = PermanentSlotLeasePeriodLength;
+7 -7
View File
@@ -91,7 +91,7 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {
/// The overarching event type.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// The type representing the leasing system.
type Leaser: Leaser<
@@ -710,7 +710,7 @@ mod tests {
type BlockLength = ();
type DbWeight = ();
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = BlockNumber;
type Hash = H256;
@@ -718,7 +718,7 @@ mod tests {
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type Version = ();
type PalletInfo = PalletInfo;
@@ -739,7 +739,7 @@ mod tests {
impl pallet_balances::Config for Test {
type Balance = u64;
type DustRemoval = ();
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
@@ -867,7 +867,7 @@ mod tests {
}
impl Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Leaser = TestLeaser;
type Registrar = TestRegistrar<Self>;
type EndingPeriod = EndingPeriod;
@@ -1729,9 +1729,9 @@ mod benchmarking {
use frame_benchmarking::{account, benchmarks, whitelisted_caller};
fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
let events = frame_system::Pallet::<T>::events();
let system_event: <T as frame_system::Config>::Event = generic_event.into();
let system_event: <T as frame_system::Config>::RuntimeEvent = generic_event.into();
// compare to the last event record
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
assert_eq!(event, &system_event);
+14 -14
View File
@@ -172,7 +172,7 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {
/// The overarching event type.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
type VestingSchedule: VestingSchedule<Self::AccountId, Moment = Self::BlockNumber>;
#[pallet::constant]
type Prefix: Get<&'static [u8]>;
@@ -597,11 +597,11 @@ impl<T: Config> Pallet<T> {
#[scale_info(skip_type_params(T))]
pub struct PrevalidateAttests<T: Config + Send + Sync>(sp_std::marker::PhantomData<T>)
where
<T as frame_system::Config>::Call: IsSubType<Call<T>>;
<T as frame_system::Config>::RuntimeCall: IsSubType<Call<T>>;
impl<T: Config + Send + Sync> Debug for PrevalidateAttests<T>
where
<T as frame_system::Config>::Call: IsSubType<Call<T>>,
<T as frame_system::Config>::RuntimeCall: IsSubType<Call<T>>,
{
#[cfg(feature = "std")]
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
@@ -616,7 +616,7 @@ where
impl<T: Config + Send + Sync> PrevalidateAttests<T>
where
<T as frame_system::Config>::Call: IsSubType<Call<T>>,
<T as frame_system::Config>::RuntimeCall: IsSubType<Call<T>>,
{
/// Create new `SignedExtension` to check runtime version.
pub fn new() -> Self {
@@ -626,10 +626,10 @@ where
impl<T: Config + Send + Sync> SignedExtension for PrevalidateAttests<T>
where
<T as frame_system::Config>::Call: IsSubType<Call<T>>,
<T as frame_system::Config>::RuntimeCall: IsSubType<Call<T>>,
{
type AccountId = T::AccountId;
type Call = <T as frame_system::Config>::Call;
type Call = <T as frame_system::Config>::RuntimeCall;
type AdditionalSigned = ();
type Pre = ();
const IDENTIFIER: &'static str = "PrevalidateAttests";
@@ -752,7 +752,7 @@ mod tests {
type BlockLength = ();
type DbWeight = ();
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = u64;
type Hash = H256;
@@ -760,7 +760,7 @@ mod tests {
type AccountId = u64;
type Lookup = IdentityLookup<u64>;
type Header = Header;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type Version = ();
type PalletInfo = PalletInfo;
@@ -779,7 +779,7 @@ mod tests {
impl pallet_balances::Config for Test {
type Balance = u64;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
@@ -794,7 +794,7 @@ mod tests {
}
impl pallet_vesting::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BlockNumberToBalance = Identity;
type MinVestedTransfer = MinVestedTransfer;
@@ -810,7 +810,7 @@ mod tests {
}
impl Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type VestingSchedule = Vesting;
type Prefix = Prefix;
type MoveClaimOrigin = frame_system::EnsureSignedBy<Six, u64>;
@@ -1052,7 +1052,7 @@ mod tests {
fn valid_attest_transactions_are_free() {
new_test_ext().execute_with(|| {
let p = PrevalidateAttests::<Test>::new();
let c = Call::Claims(ClaimsCall::attest {
let c = RuntimeCall::Claims(ClaimsCall::attest {
statement: StatementKind::Saft.to_text().to_vec(),
});
let di = c.get_dispatch_info();
@@ -1066,13 +1066,13 @@ mod tests {
fn invalid_attest_transactions_are_recognized() {
new_test_ext().execute_with(|| {
let p = PrevalidateAttests::<Test>::new();
let c = Call::Claims(ClaimsCall::attest {
let c = RuntimeCall::Claims(ClaimsCall::attest {
statement: StatementKind::Regular.to_text().to_vec(),
});
let di = c.get_dispatch_info();
let r = p.validate(&42, &c, &di, 20);
assert!(r.is_err());
let c = Call::Claims(ClaimsCall::attest {
let c = RuntimeCall::Claims(ClaimsCall::attest {
statement: StatementKind::Saft.to_text().to_vec(),
});
let di = c.get_dispatch_info();
+9 -9
View File
@@ -189,7 +189,7 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// `PalletId` for the crowdloan pallet. An appropriate value could be `PalletId(*b"py/cfund")`
#[pallet::constant]
@@ -893,7 +893,7 @@ mod tests {
type BlockLength = ();
type DbWeight = ();
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = BlockNumber;
type Hash = H256;
@@ -901,7 +901,7 @@ mod tests {
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type Version = ();
type PalletInfo = PalletInfo;
@@ -920,7 +920,7 @@ mod tests {
impl pallet_balances::Config for Test {
type Balance = u64;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
@@ -1072,7 +1072,7 @@ mod tests {
}
impl Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type SubmissionDeposit = SubmissionDeposit;
type MinContribution = MinContribution;
type PalletId = CrowdloanPalletId;
@@ -1129,8 +1129,8 @@ mod tests {
}
}
fn last_event() -> Event {
System::events().pop().expect("Event expected").event
fn last_event() -> RuntimeEvent {
System::events().pop().expect("RuntimeEvent expected").event
}
#[test]
@@ -1906,9 +1906,9 @@ mod benchmarking {
use frame_benchmarking::{account, benchmarks, whitelisted_caller};
fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
let events = frame_system::Pallet::<T>::events();
let system_event: <T as frame_system::Config>::Event = generic_event.into();
let system_event: <T as frame_system::Config>::RuntimeEvent = generic_event.into();
// compare to the last event record
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
assert_eq!(event, &system_event);
+4 -4
View File
@@ -112,13 +112,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<Self::AccountId>;
type Header = Header;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type BlockLength = BlockLength;
type BlockWeights = BlockWeights;
@@ -136,7 +136,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;
@@ -155,7 +155,7 @@ mod tests {
type Currency = pallet_balances::Pallet<Test>;
type ApproveOrigin = frame_system::EnsureRoot<AccountId>;
type RejectOrigin = frame_system::EnsureRoot<AccountId>;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type OnSlash = ();
type ProposalBond = ();
type ProposalBondMinimum = ();
@@ -93,10 +93,10 @@ frame_support::construct_runtime!(
impl<C> frame_system::offchain::SendTransactionTypes<C> for Test
where
Call: From<C>,
RuntimeCall: From<C>,
{
type Extrinsic = UncheckedExtrinsic;
type OverarchingCall = Call;
type OverarchingCall = RuntimeCall;
}
use crate::{auctions::Error as AuctionsError, crowdloan::Error as CrowdloanError};
@@ -113,7 +113,7 @@ impl frame_system::Config for Test {
type BlockLength = ();
type DbWeight = ();
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = BlockNumber;
type Hash = H256;
@@ -121,7 +121,7 @@ impl frame_system::Config for Test {
type AccountId = AccountId;
type Lookup = IdentityLookup<AccountId>;
type Header = Header;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type Version = ();
type PalletInfo = PalletInfo;
@@ -179,7 +179,7 @@ parameter_types! {
impl pallet_balances::Config for Test {
type MaxLocks = ();
type Balance = Balance;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
@@ -201,7 +201,7 @@ parameter_types! {
}
impl paras::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = paras::TestWeightInfo;
type UnsignedPriority = ParasUnsignedPriority;
type NextSessionRotation = crate::mock::TestNextSessionRotation;
@@ -213,7 +213,7 @@ parameter_types! {
}
impl paras_registrar::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type OnSwap = (Crowdloan, Slots);
type ParaDeposit = ParaDeposit;
type DataDepositPerByte = DataDepositPerByte;
@@ -228,7 +228,7 @@ parameter_types! {
}
impl auctions::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Leaser = Slots;
type Registrar = Registrar;
type EndingPeriod = EndingPeriod;
@@ -244,7 +244,7 @@ parameter_types! {
}
impl slots::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type Registrar = Registrar;
type LeasePeriod = LeasePeriod;
@@ -262,7 +262,7 @@ parameter_types! {
}
impl crowdloan::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type PalletId = CrowdloanId;
type SubmissionDeposit = SubmissionDeposit;
type MinContribution = MinContribution;
@@ -343,11 +343,11 @@ fn run_to_session(n: u32) {
run_to_block(block_number);
}
fn last_event() -> Event {
System::events().pop().expect("Event expected").event
fn last_event() -> RuntimeEvent {
System::events().pop().expect("RuntimeEvent expected").event
}
fn contains_event(event: Event) -> bool {
fn contains_event(event: RuntimeEvent) -> bool {
System::events().iter().any(|x| x.event == event)
}
+10 -10
View File
@@ -96,7 +96,7 @@ pub mod pallet {
#[pallet::disable_frame_system_supertrait_check]
pub trait Config: configuration::Config + paras::Config {
/// The overarching event type.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// The aggregated origin type must support the `parachains` origin. We require that we can
/// infallibly convert between this origin and the system origin, but in reality, they're the
@@ -631,10 +631,10 @@ mod tests {
impl<C> frame_system::offchain::SendTransactionTypes<C> for Test
where
Call: From<C>,
RuntimeCall: From<C>,
{
type Extrinsic = UncheckedExtrinsic;
type OverarchingCall = Call;
type OverarchingCall = RuntimeCall;
}
const NORMAL_RATIO: Perbill = Perbill::from_percent(75);
@@ -649,7 +649,7 @@ mod tests {
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = BlockNumber;
type Hash = H256;
@@ -657,7 +657,7 @@ mod tests {
type AccountId = u64;
type Lookup = IdentityLookup<u64>;
type Header = Header;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type DbWeight = ();
type BlockWeights = BlockWeights;
@@ -680,7 +680,7 @@ mod tests {
impl pallet_balances::Config for Test {
type Balance = u128;
type DustRemoval = ();
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type MaxLocks = ();
@@ -698,7 +698,7 @@ mod tests {
}
impl paras::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = paras::TestWeightInfo;
type UnsignedPriority = ParasUnsignedPriority;
type NextSessionRotation = crate::mock::TestNextSessionRotation;
@@ -715,7 +715,7 @@ mod tests {
}
impl Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Currency = Balances;
type OnSwap = MockSwap;
@@ -1226,9 +1226,9 @@ mod benchmarking {
use frame_benchmarking::{account, benchmarks, whitelisted_caller};
fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
let events = frame_system::Pallet::<T>::events();
let system_event: <T as frame_system::Config>::Event = generic_event.into();
let system_event: <T as frame_system::Config>::RuntimeEvent = generic_event.into();
// compare to the last event record
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
assert_eq!(event, &system_event);
+7 -7
View File
@@ -98,7 +98,7 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {
/// The overarching event type.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// Balances Pallet
type Currency: Currency<Self::AccountId>;
@@ -511,7 +511,7 @@ mod tests {
type BlockLength = ();
type DbWeight = ();
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = u64;
type Hash = H256;
@@ -519,7 +519,7 @@ mod tests {
type AccountId = AccountId;
type Lookup = IdentityLookup<AccountId>;
type Header = Header;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type Version = ();
type PalletInfo = PalletInfo;
@@ -538,7 +538,7 @@ mod tests {
impl pallet_balances::Config for Test {
type Balance = u64;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
@@ -553,7 +553,7 @@ mod tests {
}
impl pallet_vesting::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BlockNumberToBalance = Identity;
type MinVestedTransfer = MinVestedTransfer;
@@ -574,7 +574,7 @@ mod tests {
}
impl Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type VestingSchedule = Vesting;
type ValidityOrigin = frame_system::EnsureSignedBy<ValidityOrigin, AccountId>;
@@ -1081,7 +1081,7 @@ mod tests {
);
// Vesting lock is removed in whole on block 101 (100 blocks after block 1)
System::set_block_number(100);
let vest_call = Call::Vesting(pallet_vesting::Call::<Test>::vest {});
let vest_call = RuntimeCall::Vesting(pallet_vesting::Call::<Test>::vest {});
assert_ok!(vest_call.clone().dispatch(Origin::signed(alice())));
assert_ok!(vest_call.clone().dispatch(Origin::signed(bob())));
assert_eq!(<Test as Config>::VestingSchedule::vesting_balance(&alice()), Some(45));
+7 -7
View File
@@ -74,7 +74,7 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {
/// The overarching event type.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// The currency type used for bidding.
type Currency: ReservableCurrency<Self::AccountId>;
@@ -530,7 +530,7 @@ mod tests {
type BlockWeights = ();
type BlockLength = ();
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = BlockNumber;
type Hash = H256;
@@ -538,7 +538,7 @@ mod tests {
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type DbWeight = ();
type Version = ();
@@ -558,7 +558,7 @@ mod tests {
impl pallet_balances::Config for Test {
type Balance = u64;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
@@ -575,7 +575,7 @@ mod tests {
}
impl Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type Registrar = TestRegistrar<Test>;
type LeasePeriod = LeasePeriod;
@@ -988,9 +988,9 @@ mod benchmarking {
use crate::slots::Pallet as Slots;
fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
let events = frame_system::Pallet::<T>::events();
let system_event: <T as frame_system::Config>::Event = generic_event.into();
let system_event: <T as frame_system::Config>::RuntimeEvent = generic_event.into();
// compare to the last event record
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
assert_eq!(event, &system_event);
@@ -32,8 +32,8 @@ parameter_types! {
}
impl pallet_democracy::Config for Runtime {
type Proposal = Call;
type Event = Event;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type EnactmentPeriod = EnactmentPeriod;
type VoteLockingPeriod = EnactmentPeriod;
@@ -93,8 +93,8 @@ parameter_types! {
pub type CouncilCollective = pallet_collective::Instance1;
impl pallet_collective::Config<CouncilCollective> for Runtime {
type Origin = Origin;
type Proposal = Call;
type Event = Event;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type MotionDuration = CouncilMotionDuration;
type MaxProposals = CouncilMaxProposals;
type MaxMembers = CouncilMaxMembers;
@@ -121,7 +121,7 @@ parameter_types! {
const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get());
impl pallet_elections_phragmen::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type ChangeMembers = Council;
type InitializeMembers = Council;
@@ -149,8 +149,8 @@ parameter_types! {
pub type TechnicalCollective = pallet_collective::Instance2;
impl pallet_collective::Config<TechnicalCollective> for Runtime {
type Origin = Origin;
type Proposal = Call;
type Event = Event;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type MotionDuration = TechnicalMotionDuration;
type MaxProposals = TechnicalMaxProposals;
type MaxMembers = TechnicalMaxMembers;
@@ -159,7 +159,7 @@ impl pallet_collective::Config<TechnicalCollective> for Runtime {
}
impl pallet_membership::Config<pallet_membership::Instance1> for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type AddOrigin = MoreThanHalfCouncil;
type RemoveOrigin = MoreThanHalfCouncil;
type SwapOrigin = MoreThanHalfCouncil;
+125 -116
View File
@@ -157,7 +157,7 @@ impl frame_system::Config for Runtime {
type BlockWeights = BlockWeights;
type BlockLength = BlockLength;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = Nonce;
type BlockNumber = BlockNumber;
type Hash = Hash;
@@ -165,7 +165,7 @@ impl frame_system::Config for Runtime {
type AccountId = AccountId;
type Lookup = AccountIdLookup<AccountId, ()>;
type Header = generic::Header<BlockNumber, BlakeTwo256>;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type DbWeight = RocksDbWeight;
type Version = Version;
@@ -215,10 +215,10 @@ impl PrivilegeCmp<OriginCaller> for OriginPrivilegeCmp {
}
impl pallet_scheduler::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type PalletsOrigin = OriginCaller;
type Call = Call;
type RuntimeCall = RuntimeCall;
type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = ScheduleOrigin;
type MaxScheduledPerBlock = MaxScheduledPerBlock;
@@ -236,7 +236,7 @@ parameter_types! {
impl pallet_preimage::Config for Runtime {
type WeightInfo = weights::pallet_preimage::WeightInfo<Runtime>;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type ManagerOrigin = EnsureRoot<AccountId>;
type MaxSize = PreimageMaxSize;
@@ -292,7 +292,7 @@ impl pallet_indices::Config for Runtime {
type AccountIndex = AccountIndex;
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_indices::WeightInfo<Runtime>;
}
@@ -305,7 +305,7 @@ parameter_types! {
impl pallet_balances::Config for Runtime {
type Balance = Balance;
type DustRemoval = ();
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type MaxLocks = MaxLocks;
@@ -322,7 +322,7 @@ parameter_types! {
}
impl pallet_transaction_payment::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees<Self>>;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type WeightToFee = WeightToFee;
@@ -363,7 +363,7 @@ impl_opaque_keys! {
}
impl pallet_session::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ValidatorId = AccountId;
type ValidatorIdOf = pallet_staking::StashOf<Self>;
type ShouldEndSession = Babe;
@@ -455,7 +455,7 @@ impl pallet_election_provider_multi_phase::MinerConfig for Runtime {
}
impl pallet_election_provider_multi_phase::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type EstimateCallFee = TransactionPayment;
type UnsignedPhase = UnsignedPhase;
@@ -501,7 +501,7 @@ parameter_types! {
}
impl pallet_bags_list::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ScoreProvider = Staking;
type WeightInfo = weights::pallet_bags_list::WeightInfo<Runtime>;
type BagThresholds = BagThresholds;
@@ -597,7 +597,7 @@ impl pallet_staking::Config for Runtime {
type ElectionProvider = ElectionProviderMultiPhase;
type GenesisElectionProvider = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type RewardRemainder = Treasury;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Slash = Treasury;
type Reward = ();
type SessionsPerEra = SessionsPerEra;
@@ -646,7 +646,7 @@ impl pallet_treasury::Config for Runtime {
type Currency = Balances;
type ApproveOrigin = ApproveOrigin;
type RejectOrigin = MoreThanHalfCouncil;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type OnSlash = Treasury;
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ProposalBondMinimum;
@@ -681,7 +681,7 @@ impl pallet_bounties::Config for Runtime {
type BountyValueMinimum = BountyValueMinimum;
type ChildBountyManager = ChildBounties;
type DataDepositPerByte = DataDepositPerByte;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type MaximumReasonLength = MaximumReasonLength;
type WeightInfo = weights::pallet_bounties::WeightInfo<Runtime>;
}
@@ -692,7 +692,7 @@ parameter_types! {
}
impl pallet_child_bounties::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type MaxActiveChildBountyCount = MaxActiveChildBountyCount;
type ChildBountyValueMinimum = ChildBountyValueMinimum;
type WeightInfo = weights::pallet_child_bounties::WeightInfo<Runtime>;
@@ -705,12 +705,12 @@ impl pallet_tips::Config for Runtime {
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_tips::WeightInfo<Runtime>;
}
impl pallet_offences::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = Staking;
}
@@ -725,7 +725,7 @@ parameter_types! {
impl pallet_im_online::Config for Runtime {
type AuthorityId = ImOnlineId;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ValidatorSet = Historical;
type NextSessionRotation = Babe;
type ReportUnresponsiveness = Offences;
@@ -737,8 +737,7 @@ impl pallet_im_online::Config for Runtime {
}
impl pallet_grandpa::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type KeyOwnerProof =
<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
@@ -764,14 +763,14 @@ impl pallet_grandpa::Config for Runtime {
/// format of the chain.
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime
where
Call: From<LocalCall>,
RuntimeCall: From<LocalCall>,
{
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
call: Call,
call: RuntimeCall,
public: <Signature as Verify>::Signer,
account: AccountId,
nonce: <Runtime as frame_system::Config>::Index,
) -> Option<(Call, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
use sp_runtime::traits::StaticLookup;
// take the biggest period possible.
let period =
@@ -815,10 +814,10 @@ impl frame_system::offchain::SigningTypes for Runtime {
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime
where
Call: From<C>,
RuntimeCall: From<C>,
{
type Extrinsic = UncheckedExtrinsic;
type OverarchingCall = Call;
type OverarchingCall = RuntimeCall;
}
parameter_types! {
@@ -826,7 +825,7 @@ parameter_types! {
}
impl claims::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type VestingSchedule = Vesting;
type Prefix = Prefix;
type MoveClaimOrigin =
@@ -845,7 +844,7 @@ parameter_types! {
}
impl pallet_identity::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BasicDeposit = BasicDeposit;
type FieldDeposit = FieldDeposit;
@@ -860,8 +859,8 @@ impl pallet_identity::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<Runtime>;
}
@@ -875,8 +874,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;
@@ -892,9 +891,9 @@ parameter_types! {
}
impl pallet_recovery::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
type Call = Call;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type ConfigDepositBase = ConfigDepositBase;
type FriendDepositFactor = FriendDepositFactor;
@@ -915,7 +914,7 @@ parameter_types! {
}
impl pallet_society::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>;
type CandidateDeposit = CandidateDeposit;
@@ -938,7 +937,7 @@ parameter_types! {
}
impl pallet_vesting::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
@@ -988,86 +987,95 @@ impl Default for ProxyType {
}
}
impl InstanceFilter<Call> for ProxyType {
fn filter(&self, c: &Call) -> bool {
impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
match self {
ProxyType::Any => true,
ProxyType::NonTransfer => matches!(
c,
Call::System(..) |
Call::Babe(..) |
Call::Timestamp(..) |
Call::Indices(pallet_indices::Call::claim {..}) |
Call::Indices(pallet_indices::Call::free {..}) |
Call::Indices(pallet_indices::Call::freeze {..}) |
RuntimeCall::System(..) |
RuntimeCall::Babe(..) |
RuntimeCall::Timestamp(..) |
RuntimeCall::Indices(pallet_indices::Call::claim {..}) |
RuntimeCall::Indices(pallet_indices::Call::free {..}) |
RuntimeCall::Indices(pallet_indices::Call::freeze {..}) |
// Specifically omitting Indices `transfer`, `force_transfer`
// Specifically omitting the entire Balances pallet
Call::Authorship(..) |
Call::Staking(..) |
Call::Session(..) |
Call::Grandpa(..) |
Call::ImOnline(..) |
Call::Democracy(..) |
Call::Council(..) |
Call::TechnicalCommittee(..) |
Call::PhragmenElection(..) |
Call::TechnicalMembership(..) |
Call::Treasury(..) |
Call::Bounties(..) |
Call::ChildBounties(..) |
Call::Tips(..) |
Call::Claims(..) |
Call::Utility(..) |
Call::Identity(..) |
Call::Society(..) |
Call::Recovery(pallet_recovery::Call::as_recovered {..}) |
Call::Recovery(pallet_recovery::Call::vouch_recovery {..}) |
Call::Recovery(pallet_recovery::Call::claim_recovery {..}) |
Call::Recovery(pallet_recovery::Call::close_recovery {..}) |
Call::Recovery(pallet_recovery::Call::remove_recovery {..}) |
Call::Recovery(pallet_recovery::Call::cancel_recovered {..}) |
RuntimeCall::Authorship(..) |
RuntimeCall::Staking(..) |
RuntimeCall::Session(..) |
RuntimeCall::Grandpa(..) |
RuntimeCall::ImOnline(..) |
RuntimeCall::Democracy(..) |
RuntimeCall::Council(..) |
RuntimeCall::TechnicalCommittee(..) |
RuntimeCall::PhragmenElection(..) |
RuntimeCall::TechnicalMembership(..) |
RuntimeCall::Treasury(..) |
RuntimeCall::Bounties(..) |
RuntimeCall::ChildBounties(..) |
RuntimeCall::Tips(..) |
RuntimeCall::Claims(..) |
RuntimeCall::Utility(..) |
RuntimeCall::Identity(..) |
RuntimeCall::Society(..) |
RuntimeCall::Recovery(pallet_recovery::Call::as_recovered {..}) |
RuntimeCall::Recovery(pallet_recovery::Call::vouch_recovery {..}) |
RuntimeCall::Recovery(pallet_recovery::Call::claim_recovery {..}) |
RuntimeCall::Recovery(pallet_recovery::Call::close_recovery {..}) |
RuntimeCall::Recovery(pallet_recovery::Call::remove_recovery {..}) |
RuntimeCall::Recovery(pallet_recovery::Call::cancel_recovered {..}) |
// Specifically omitting Recovery `create_recovery`, `initiate_recovery`
Call::Vesting(pallet_vesting::Call::vest {..}) |
Call::Vesting(pallet_vesting::Call::vest_other {..}) |
RuntimeCall::Vesting(pallet_vesting::Call::vest {..}) |
RuntimeCall::Vesting(pallet_vesting::Call::vest_other {..}) |
// Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer`
Call::Scheduler(..) |
Call::Proxy(..) |
Call::Multisig(..) |
Call::Gilt(..) |
Call::Registrar(paras_registrar::Call::register {..}) |
Call::Registrar(paras_registrar::Call::deregister {..}) |
RuntimeCall::Scheduler(..) |
RuntimeCall::Proxy(..) |
RuntimeCall::Multisig(..) |
RuntimeCall::Gilt(..) |
RuntimeCall::Registrar(paras_registrar::Call::register {..}) |
RuntimeCall::Registrar(paras_registrar::Call::deregister {..}) |
// Specifically omitting Registrar `swap`
Call::Registrar(paras_registrar::Call::reserve {..}) |
Call::Crowdloan(..) |
Call::Slots(..) |
Call::Auctions(..) | // Specifically omitting the entire XCM Pallet
Call::VoterList(..) |
Call::NominationPools(..)
),
ProxyType::Governance => matches!(
c,
Call::Democracy(..) |
Call::Council(..) | Call::TechnicalCommittee(..) |
Call::PhragmenElection(..) |
Call::Treasury(..) | Call::Bounties(..) |
Call::Tips(..) | Call::Utility(..) |
Call::ChildBounties(..)
RuntimeCall::Registrar(paras_registrar::Call::reserve {..}) |
RuntimeCall::Crowdloan(..) |
RuntimeCall::Slots(..) |
RuntimeCall::Auctions(..) | // Specifically omitting the entire XCM Pallet
RuntimeCall::VoterList(..) |
RuntimeCall::NominationPools(..)
),
ProxyType::Governance =>
matches!(
c,
RuntimeCall::Democracy(..) |
RuntimeCall::Council(..) | RuntimeCall::TechnicalCommittee(..) |
RuntimeCall::PhragmenElection(..) |
RuntimeCall::Treasury(..) |
RuntimeCall::Bounties(..) |
RuntimeCall::Tips(..) | RuntimeCall::Utility(..) |
RuntimeCall::ChildBounties(..)
),
ProxyType::Staking => {
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..))
matches!(
c,
RuntimeCall::Staking(..) | RuntimeCall::Session(..) | RuntimeCall::Utility(..)
)
},
ProxyType::IdentityJudgement => matches!(
c,
Call::Identity(pallet_identity::Call::provide_judgement { .. }) | Call::Utility(..)
RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) |
RuntimeCall::Utility(..)
),
ProxyType::CancelProxy => {
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. }))
matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }))
},
ProxyType::Auction => matches!(
c,
Call::Auctions(..) | Call::Crowdloan(..) | Call::Registrar(..) | Call::Slots(..)
RuntimeCall::Auctions(..) |
RuntimeCall::Crowdloan(..) |
RuntimeCall::Registrar(..) |
RuntimeCall::Slots(..)
),
ProxyType::Society => matches!(c, Call::Society(..)),
ProxyType::Society => matches!(c, RuntimeCall::Society(..)),
}
}
fn is_superset(&self, o: &Self) -> bool {
@@ -1082,8 +1090,8 @@ impl InstanceFilter<Call> 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;
@@ -1109,7 +1117,7 @@ impl parachains_session_info::Config for Runtime {
}
impl parachains_inclusion::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DisputesHandler = ParasDisputes;
type RewardValidators = parachains_reward_points::RewardValidatorsWithEraPoints<Runtime>;
}
@@ -1119,7 +1127,7 @@ parameter_types! {
}
impl parachains_paras::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::runtime_parachains_paras::WeightInfo<Runtime>;
type UnsignedPriority = ParasUnsignedPriority;
type NextSessionRotation = Babe;
@@ -1130,7 +1138,7 @@ parameter_types! {
}
impl parachains_ump::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type UmpSink =
crate::parachains_ump::XcmSink<xcm_executor::XcmExecutor<xcm_config::XcmConfig>, Runtime>;
type FirstMessageFactorPercent = FirstMessageFactorPercent;
@@ -1141,7 +1149,7 @@ impl parachains_ump::Config for Runtime {
impl parachains_dmp::Config for Runtime {}
impl parachains_hrmp::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Currency = Balances;
type WeightInfo = weights::runtime_parachains_hrmp::WeightInfo<Runtime>;
@@ -1160,7 +1168,7 @@ impl parachains_initializer::Config for Runtime {
}
impl parachains_disputes::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type RewardValidators = parachains_reward_points::RewardValidatorsWithEraPoints<Runtime>;
type PunishValidators = ();
type WeightInfo = weights::runtime_parachains_disputes::WeightInfo<Runtime>;
@@ -1171,7 +1179,7 @@ parameter_types! {
}
impl paras_registrar::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Currency = Balances;
type OnSwap = (Crowdloan, Slots);
@@ -1186,7 +1194,7 @@ parameter_types! {
}
impl slots::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type Registrar = Registrar;
type LeasePeriod = LeasePeriod;
@@ -1205,7 +1213,7 @@ parameter_types! {
}
impl crowdloan::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type PalletId = CrowdloanId;
type SubmissionDeposit = SubmissionDeposit;
type MinContribution = MinContribution;
@@ -1230,7 +1238,7 @@ type AuctionInitiate = EitherOfDiverse<
>;
impl auctions::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Leaser = Slots;
type Registrar = Registrar;
type EndingPeriod = EndingPeriod;
@@ -1252,7 +1260,7 @@ parameter_types! {
}
impl pallet_gilt::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type CurrencyBalance = Balance;
type AdminOrigin = MoreThanHalfCouncil;
@@ -1275,7 +1283,7 @@ parameter_types! {
}
impl pallet_nomination_pools::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_nomination_pools::WeightInfo<Self>;
type Currency = Balances;
type CurrencyBalance = Balance;
@@ -1425,7 +1433,8 @@ pub type SignedExtra = (
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Runtime,
@@ -1436,7 +1445,7 @@ pub type Executive = frame_executive::Executive<
pallet_nomination_pools::migration::v3::MigrateToV3<Runtime>,
>;
/// The payload being signed in the transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
@@ -1608,7 +1617,7 @@ sp_api::impl_runtime_apis! {
fn candidate_events() -> Vec<CandidateEvent<Hash>> {
parachains_runtime_api_impl::candidate_events::<Runtime, _>(|ev| {
match ev {
Event::ParaInclusion(ev) => {
RuntimeEvent::ParaInclusion(ev) => {
Some(ev)
}
_ => None,
@@ -1834,13 +1843,13 @@ sp_api::impl_runtime_apis! {
}
}
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, Call>
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
for Runtime
{
fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo<Balance> {
fn query_call_info(call: RuntimeCall, len: u32) -> RuntimeDispatchInfo<Balance> {
TransactionPayment::query_call_info(call, len)
}
fn query_call_fee_details(call: Call, len: u32) -> FeeDetails<Balance> {
fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_call_fee_details(call, len)
}
}
@@ -1965,7 +1974,7 @@ sp_api::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()))
@@ -2084,7 +2093,7 @@ mod multiplier_tests {
println!("calling {:?}", call);
let info = call.get_dispatch_info();
// convert to outer call.
let call = Call::System(call);
let call = RuntimeCall::System(call);
let len = call.using_encoded(|e| e.len()) as u32;
let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default()
+2 -2
View File
@@ -87,7 +87,7 @@ fn transfer_cost_min_multiplier() {
};
let info = call.get_dispatch_info();
// convert to outer call.
let call = Call::Balances(call);
let call = RuntimeCall::Balances(call);
let len = call.using_encoded(|e| e.len()) as u32;
let mut ext = sp_io::TestExternalities::new_empty();
@@ -173,5 +173,5 @@ fn era_payout_should_give_sensible_results() {
#[test]
fn call_size() {
Call::assert_size_under(230);
RuntimeCall::assert_size_under(230);
}
@@ -72,8 +72,8 @@ impl WeighMultiAssets for MultiAssets {
}
}
pub struct KusamaXcmWeight<Call>(core::marker::PhantomData<Call>);
impl<Call> XcmWeightInfo<Call> for KusamaXcmWeight<Call> {
pub struct KusamaXcmWeight<RuntimeCall>(core::marker::PhantomData<RuntimeCall>);
impl<RuntimeCall> XcmWeightInfo<RuntimeCall> for KusamaXcmWeight<RuntimeCall> {
fn withdraw_asset(assets: &MultiAssets) -> XCMWeight {
assets.weigh_multi_assets(XcmBalancesWeight::<Runtime>::withdraw_asset())
}
@@ -99,7 +99,7 @@ impl<Call> XcmWeightInfo<Call> for KusamaXcmWeight<Call> {
fn transact(
_origin_type: &OriginKind,
_require_weight_at_most: &u64,
_call: &DoubleEncoded<Call>,
_call: &DoubleEncoded<RuntimeCall>,
) -> XCMWeight {
XcmGeneric::<Runtime>::transact().ref_time()
}
@@ -179,10 +179,10 @@ impl<Call> XcmWeightInfo<Call> for KusamaXcmWeight<Call> {
fn refund_surplus() -> XCMWeight {
XcmGeneric::<Runtime>::refund_surplus().ref_time()
}
fn set_error_handler(_xcm: &Xcm<Call>) -> XCMWeight {
fn set_error_handler(_xcm: &Xcm<RuntimeCall>) -> XCMWeight {
XcmGeneric::<Runtime>::set_error_handler().ref_time()
}
fn set_appendix(_xcm: &Xcm<Call>) -> XCMWeight {
fn set_appendix(_xcm: &Xcm<RuntimeCall>) -> XCMWeight {
XcmGeneric::<Runtime>::set_appendix().ref_time()
}
fn clear_error() -> XCMWeight {
+11 -8
View File
@@ -17,8 +17,8 @@
//! XCM configurations for the Kusama runtime.
use super::{
parachains_origin, AccountId, Balances, Call, CouncilCollective, Event, Origin, ParaId,
Runtime, WeightToFee, XcmPallet,
parachains_origin, AccountId, Balances, CouncilCollective, Origin, ParaId, Runtime,
RuntimeCall, RuntimeEvent, WeightToFee, XcmPallet,
};
use frame_support::{match_types, parameter_types, traits::Everything};
use runtime_common::{xcm_sender, ToAuthor};
@@ -131,7 +131,7 @@ pub type Barrier = (
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type Call = Call;
type RuntimeCall = RuntimeCall;
type XcmSender = XcmRouter;
type AssetTransactor = LocalAssetTransactor;
type OriginConverter = LocalOriginConverter;
@@ -139,8 +139,11 @@ impl xcm_executor::Config for XcmConfig {
type IsTeleporter = TrustedTeleporters;
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher =
WeightInfoBounds<crate::weights::xcm::KusamaXcmWeight<Call>, Call, MaxInstructions>;
type Weigher = WeightInfoBounds<
crate::weights::xcm::KusamaXcmWeight<RuntimeCall>,
RuntimeCall,
MaxInstructions,
>;
// The weight trader piggybacks on the existing transaction-fee conversion logic.
type Trader = UsingComponents<WeightToFee, KsmLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = XcmPallet;
@@ -170,7 +173,7 @@ pub type LocalOriginToLocation = (
SignedToAccountId32<Origin, AccountId, KusamaNetwork>,
);
impl pallet_xcm::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
// We only allow the council to send messages. This is basically safe to enable for everyone
// (safe the possibility of someone spamming the parachain if they're willing to pay the KSM to
// send from the Relay-chain), but it's useless until we bring in XCM v3 which will make
@@ -186,10 +189,10 @@ impl pallet_xcm::Config for Runtime {
// Anyone is able to use reserve transfers regardless of who they are and what they want to
// transfer.
type XcmReserveTransferFilter = Everything;
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
type Weigher = FixedWeightBounds<BaseXcmWeight, RuntimeCall, MaxInstructions>;
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}
+1 -1
View File
@@ -410,7 +410,7 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config + configuration::Config + session_info::Config {
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
type RewardValidators: RewardValidators;
type PunishValidators: PunishValidators;
+1 -1
View File
@@ -239,7 +239,7 @@ pub mod pallet {
frame_system::Config + configuration::Config + paras::Config + dmp::Config
{
/// The outer event type.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
type Origin: From<crate::Origin>
+ From<<Self as frame_system::Config>::Origin>
@@ -39,9 +39,9 @@ fn register_parachain_with_balance<T: Config>(id: ParaId, balance: BalanceOf<T>)
T::Currency::make_free_balance_be(&id.into_account_truncating(), balance);
}
fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
let events = frame_system::Pallet::<T>::events();
let system_event: <T as frame_system::Config>::Event = generic_event.into();
let system_event: <T as frame_system::Config>::RuntimeEvent = generic_event.into();
// compare to the last event record
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
assert_eq!(event, &system_event);
@@ -16,8 +16,8 @@
use super::*;
use crate::mock::{
new_test_ext, Configuration, Event as MockEvent, Hrmp, MockGenesisConfig, Paras, ParasShared,
System, Test,
new_test_ext, Configuration, Hrmp, MockGenesisConfig, Paras, ParasShared,
RuntimeEvent as MockEvent, System, Test,
};
use frame_support::{assert_noop, assert_ok, traits::Currency as _};
use primitives::v2::BlockNumber;
@@ -198,7 +198,7 @@ pub mod pallet {
+ hrmp::Config
+ configuration::Config
{
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
type DisputesHandler: disputes::DisputesHandler<Self::BlockNumber>;
type RewardValidators: RewardValidators;
}
+12 -12
View File
@@ -73,10 +73,10 @@ frame_support::construct_runtime!(
impl<C> frame_system::offchain::SendTransactionTypes<C> for Test
where
Call: From<C>,
RuntimeCall: From<C>,
{
type Extrinsic = UncheckedExtrinsic;
type OverarchingCall = Call;
type OverarchingCall = RuntimeCall;
}
parameter_types! {
@@ -93,7 +93,7 @@ impl frame_system::Config for Test {
type BlockLength = ();
type DbWeight = ();
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = BlockNumber;
type Hash = H256;
@@ -101,7 +101,7 @@ impl frame_system::Config for Test {
type AccountId = u64;
type Lookup = IdentityLookup<u64>;
type Header = Header;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type Version = ();
type PalletInfo = PalletInfo;
@@ -123,7 +123,7 @@ impl pallet_balances::Config for Test {
type MaxReserves = ();
type ReserveIdentifier = [u8; 8];
type Balance = Balance;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
@@ -213,7 +213,7 @@ impl frame_support::traits::EstimateNextSessionRotation<u32> for TestNextSession
}
impl crate::paras::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = crate::paras::TestWeightInfo;
type UnsignedPriority = ParasUnsignedPriority;
type NextSessionRotation = TestNextSessionRotation;
@@ -226,7 +226,7 @@ parameter_types! {
}
impl crate::ump::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type UmpSink = TestUmpSink;
type FirstMessageFactorPercent = FirstMessageFactorPercent;
type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;
@@ -234,14 +234,14 @@ impl crate::ump::Config for Test {
}
impl crate::hrmp::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Currency = pallet_balances::Pallet<Test>;
type WeightInfo = crate::hrmp::TestWeightInfo;
}
impl crate::disputes::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type RewardValidators = Self;
type PunishValidators = Self;
type WeightInfo = crate::disputes::TestWeightInfo;
@@ -292,7 +292,7 @@ impl crate::disputes::PunishValidators for Test {
impl crate::scheduler::Config for Test {}
impl crate::inclusion::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DisputesHandler = Disputes;
type RewardValidators = TestRewardValidators;
}
@@ -455,9 +455,9 @@ pub struct MockGenesisConfig {
pub paras: crate::paras::GenesisConfig,
}
pub fn assert_last_event(generic_event: Event) {
pub fn assert_last_event(generic_event: RuntimeEvent) {
let events = frame_system::Pallet::<Test>::events();
let system_event: <Test as frame_system::Config>::Event = generic_event.into();
let system_event: <Test as frame_system::Config>::RuntimeEvent = generic_event.into();
// compare to the last event record
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
assert_eq!(event, &system_event);
@@ -31,9 +31,9 @@ use self::pvf_check::{VoteCause, VoteOutcome};
// shouldn't exceed this number.
const SAMPLE_SIZE: u32 = 1024;
fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
let events = frame_system::Pallet::<T>::events();
let system_event: <T as frame_system::Config>::Event = generic_event.into();
let system_event: <T as frame_system::Config>::RuntimeEvent = generic_event.into();
// compare to the last event record
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
assert_eq!(event, &system_event);
+1 -1
View File
@@ -473,7 +473,7 @@ pub mod pallet {
+ shared::Config
+ frame_system::offchain::SendTransactionTypes<Call<Self>>
{
type Event: From<Event> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
#[pallet::constant]
type UnsignedPriority: Get<TransactionPriority>;
@@ -112,8 +112,12 @@ fn check_code_is_not_stored(validation_code: &ValidationCode) {
/// An utility for checking that certain events were deposited.
struct EventValidator {
events:
Vec<frame_system::EventRecord<<Test as frame_system::Config>::Event, primitives::v2::Hash>>,
events: Vec<
frame_system::EventRecord<
<Test as frame_system::Config>::RuntimeEvent,
primitives::v2::Hash,
>,
>,
}
impl EventValidator {
@@ -323,7 +323,7 @@ pub fn candidate_pending_availability<T: initializer::Config>(
pub fn candidate_events<T, F>(extract_event: F) -> Vec<CandidateEvent<T::Hash>>
where
T: initializer::Config,
F: Fn(<T as frame_system::Config>::Event) -> Option<inclusion::Event<T>>,
F: Fn(<T as frame_system::Config>::RuntimeEvent) -> Option<inclusion::Event<T>>,
{
use inclusion::Event as RawEvent;
+6 -4
View File
@@ -93,7 +93,9 @@ fn upward_message_id(data: &[u8]) -> MessageId {
sp_io::hashing::blake2_256(data)
}
impl<XcmExecutor: xcm::latest::ExecuteXcm<C::Call>, C: Config> UmpSink for XcmSink<XcmExecutor, C> {
impl<XcmExecutor: xcm::latest::ExecuteXcm<C::RuntimeCall>, C: Config> UmpSink
for XcmSink<XcmExecutor, C>
{
fn process_upward_message(
origin: ParaId,
mut data: &[u8],
@@ -106,13 +108,13 @@ impl<XcmExecutor: xcm::latest::ExecuteXcm<C::Call>, C: Config> UmpSink for XcmSi
};
let id = upward_message_id(&data[..]);
let maybe_msg_and_weight = VersionedXcm::<C::Call>::decode_all_with_depth_limit(
let maybe_msg_and_weight = VersionedXcm::<C::RuntimeCall>::decode_all_with_depth_limit(
xcm::MAX_XCM_DECODE_DEPTH,
&mut data,
)
.map(|xcm| {
(
Xcm::<C::Call>::try_from(xcm),
Xcm::<C::RuntimeCall>::try_from(xcm),
// NOTE: We are overestimating slightly here.
// The benchmark is timing this whole function with different message sizes and a NOOP extrinsic to
// measure the size-dependent weight. But as we use the weight funtion **in** the benchmarked funtion we
@@ -218,7 +220,7 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config + configuration::Config {
/// The aggregate event.
type Event: From<Event> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// A place where all received upward messages are funneled.
type UmpSink: UmpSink;
@@ -18,9 +18,9 @@ use super::{Pallet as Ump, *};
use frame_system::RawOrigin;
use xcm::prelude::*;
fn assert_last_event_type<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event_type<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
let events = frame_system::Pallet::<T>::events();
let system_event: <T as frame_system::Config>::Event = generic_event.into();
let system_event: <T as frame_system::Config>::RuntimeEvent = generic_event.into();
// compare to the last event record
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
assert_eq!(sp_std::mem::discriminant(event), sp_std::mem::discriminant(&system_event));
+124 -115
View File
@@ -147,7 +147,7 @@ impl frame_system::Config for Runtime {
type BlockWeights = BlockWeights;
type BlockLength = BlockLength;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = Nonce;
type BlockNumber = BlockNumber;
type Hash = Hash;
@@ -155,7 +155,7 @@ impl frame_system::Config for Runtime {
type AccountId = AccountId;
type Lookup = AccountIdLookup<AccountId, ()>;
type Header = generic::Header<BlockNumber, BlakeTwo256>;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type DbWeight = RocksDbWeight;
type Version = Version;
@@ -205,10 +205,10 @@ impl PrivilegeCmp<OriginCaller> for OriginPrivilegeCmp {
}
impl pallet_scheduler::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type PalletsOrigin = OriginCaller;
type Call = Call;
type RuntimeCall = RuntimeCall;
type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = ScheduleOrigin;
type MaxScheduledPerBlock = MaxScheduledPerBlock;
@@ -226,7 +226,7 @@ parameter_types! {
impl pallet_preimage::Config for Runtime {
type WeightInfo = weights::pallet_preimage::WeightInfo<Runtime>;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type ManagerOrigin = EnsureRoot<AccountId>;
type MaxSize = PreimageMaxSize;
@@ -282,7 +282,7 @@ impl pallet_indices::Config for Runtime {
type AccountIndex = AccountIndex;
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_indices::WeightInfo<Runtime>;
}
@@ -295,7 +295,7 @@ parameter_types! {
impl pallet_balances::Config for Runtime {
type Balance = Balance;
type DustRemoval = ();
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type MaxLocks = MaxLocks;
@@ -312,7 +312,7 @@ parameter_types! {
}
impl pallet_transaction_payment::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees<Runtime>>;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type WeightToFee = WeightToFee;
@@ -354,7 +354,7 @@ impl_opaque_keys! {
}
impl pallet_session::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ValidatorId = AccountId;
type ValidatorIdOf = pallet_staking::StashOf<Self>;
type ShouldEndSession = Babe;
@@ -446,7 +446,7 @@ impl pallet_election_provider_multi_phase::MinerConfig for Runtime {
}
impl pallet_election_provider_multi_phase::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type EstimateCallFee = TransactionPayment;
type SignedPhase = SignedPhase;
@@ -492,7 +492,7 @@ parameter_types! {
}
impl pallet_bags_list::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ScoreProvider = Staking;
type WeightInfo = weights::pallet_bags_list::WeightInfo<Runtime>;
type BagThresholds = BagThresholds;
@@ -540,7 +540,7 @@ impl pallet_staking::Config for Runtime {
type UnixTime = Timestamp;
type CurrencyToVote = CurrencyToVote;
type RewardRemainder = Treasury;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Slash = Treasury;
type Reward = ();
type SessionsPerEra = SessionsPerEra;
@@ -573,7 +573,7 @@ parameter_types! {
}
impl pallet_identity::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BasicDeposit = BasicDeposit;
type FieldDeposit = FieldDeposit;
@@ -600,8 +600,8 @@ parameter_types! {
}
impl pallet_democracy::Config for Runtime {
type Proposal = Call;
type Event = Event;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type EnactmentPeriod = EnactmentPeriod;
type VoteLockingPeriod = EnactmentPeriod;
@@ -671,8 +671,8 @@ parameter_types! {
pub type CouncilCollective = pallet_collective::Instance1;
impl pallet_collective::Config<CouncilCollective> for Runtime {
type Origin = Origin;
type Proposal = Call;
type Event = Event;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type MotionDuration = CouncilMotionDuration;
type MaxProposals = CouncilMaxProposals;
type MaxMembers = CouncilMaxMembers;
@@ -699,7 +699,7 @@ parameter_types! {
const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get());
impl pallet_elections_phragmen::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type PalletId = PhragmenElectionPalletId;
type Currency = Balances;
type ChangeMembers = Council;
@@ -727,8 +727,8 @@ parameter_types! {
pub type TechnicalCollective = pallet_collective::Instance2;
impl pallet_collective::Config<TechnicalCollective> for Runtime {
type Origin = Origin;
type Proposal = Call;
type Event = Event;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type MotionDuration = TechnicalMotionDuration;
type MaxProposals = TechnicalMaxProposals;
type MaxMembers = TechnicalMaxMembers;
@@ -737,7 +737,7 @@ impl pallet_collective::Config<TechnicalCollective> for Runtime {
}
impl pallet_membership::Config<pallet_membership::Instance1> for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type AddOrigin = MoreThanHalfCouncil;
type RemoveOrigin = MoreThanHalfCouncil;
type SwapOrigin = MoreThanHalfCouncil;
@@ -778,7 +778,7 @@ impl pallet_treasury::Config for Runtime {
type Currency = Balances;
type ApproveOrigin = ApproveOrigin;
type RejectOrigin = MoreThanHalfCouncil;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type OnSlash = Treasury;
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ProposalBondMinimum;
@@ -804,7 +804,7 @@ parameter_types! {
}
impl pallet_bounties::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BountyDepositBase = BountyDepositBase;
type BountyDepositPayoutDelay = BountyDepositPayoutDelay;
type BountyUpdatePeriod = BountyUpdatePeriod;
@@ -824,14 +824,14 @@ parameter_types! {
}
impl pallet_child_bounties::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type MaxActiveChildBountyCount = MaxActiveChildBountyCount;
type ChildBountyValueMinimum = ChildBountyValueMinimum;
type WeightInfo = weights::pallet_child_bounties::WeightInfo<Runtime>;
}
impl pallet_tips::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DataDepositPerByte = DataDepositPerByte;
type MaximumReasonLength = MaximumReasonLength;
type Tippers = PhragmenElection;
@@ -842,7 +842,7 @@ impl pallet_tips::Config for Runtime {
}
impl pallet_offences::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = Staking;
}
@@ -859,7 +859,7 @@ parameter_types! {
impl pallet_im_online::Config for Runtime {
type AuthorityId = ImOnlineId;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ValidatorSet = Historical;
type NextSessionRotation = Babe;
type ReportUnresponsiveness = Offences;
@@ -871,8 +871,7 @@ impl pallet_im_online::Config for Runtime {
}
impl pallet_grandpa::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type KeyOwnerProof =
<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
@@ -898,14 +897,14 @@ impl pallet_grandpa::Config for Runtime {
/// format of the chain.
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime
where
Call: From<LocalCall>,
RuntimeCall: From<LocalCall>,
{
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
call: Call,
call: RuntimeCall,
public: <Signature as Verify>::Signer,
account: AccountId,
nonce: <Runtime as frame_system::Config>::Index,
) -> Option<(Call, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
use sp_runtime::traits::StaticLookup;
// take the biggest period possible.
let period =
@@ -950,10 +949,10 @@ impl frame_system::offchain::SigningTypes for Runtime {
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime
where
Call: From<C>,
RuntimeCall: From<C>,
{
type Extrinsic = UncheckedExtrinsic;
type OverarchingCall = Call;
type OverarchingCall = RuntimeCall;
}
parameter_types! {
@@ -966,7 +965,7 @@ parameter_types! {
}
impl claims::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type VestingSchedule = Vesting;
type Prefix = Prefix;
/// At least 3/4 of the council must agree to a claim move before it can happen.
@@ -980,7 +979,7 @@ parameter_types! {
}
impl pallet_vesting::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
@@ -989,8 +988,8 @@ impl pallet_vesting::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<Runtime>;
}
@@ -1004,8 +1003,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;
@@ -1085,75 +1084,84 @@ impl Default for ProxyType {
Self::Any
}
}
impl InstanceFilter<Call> for ProxyType {
fn filter(&self, c: &Call) -> bool {
impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
match self {
ProxyType::Any => true,
ProxyType::NonTransfer => matches!(
c,
Call::System(..) |
Call::Scheduler(..) |
Call::Babe(..) |
Call::Timestamp(..) |
Call::Indices(pallet_indices::Call::claim{..}) |
Call::Indices(pallet_indices::Call::free{..}) |
Call::Indices(pallet_indices::Call::freeze{..}) |
RuntimeCall::System(..) |
RuntimeCall::Scheduler(..) |
RuntimeCall::Babe(..) |
RuntimeCall::Timestamp(..) |
RuntimeCall::Indices(pallet_indices::Call::claim{..}) |
RuntimeCall::Indices(pallet_indices::Call::free{..}) |
RuntimeCall::Indices(pallet_indices::Call::freeze{..}) |
// Specifically omitting Indices `transfer`, `force_transfer`
// Specifically omitting the entire Balances pallet
Call::Authorship(..) |
Call::Staking(..) |
Call::Session(..) |
Call::Grandpa(..) |
Call::ImOnline(..) |
Call::Democracy(..) |
Call::Council(..) |
Call::TechnicalCommittee(..) |
Call::PhragmenElection(..) |
Call::TechnicalMembership(..) |
Call::Treasury(..) |
Call::Bounties(..) |
Call::ChildBounties(..) |
Call::Tips(..) |
Call::Claims(..) |
Call::Vesting(pallet_vesting::Call::vest{..}) |
Call::Vesting(pallet_vesting::Call::vest_other{..}) |
RuntimeCall::Authorship(..) |
RuntimeCall::Staking(..) |
RuntimeCall::Session(..) |
RuntimeCall::Grandpa(..) |
RuntimeCall::ImOnline(..) |
RuntimeCall::Democracy(..) |
RuntimeCall::Council(..) |
RuntimeCall::TechnicalCommittee(..) |
RuntimeCall::PhragmenElection(..) |
RuntimeCall::TechnicalMembership(..) |
RuntimeCall::Treasury(..) |
RuntimeCall::Bounties(..) |
RuntimeCall::ChildBounties(..) |
RuntimeCall::Tips(..) |
RuntimeCall::Claims(..) |
RuntimeCall::Vesting(pallet_vesting::Call::vest{..}) |
RuntimeCall::Vesting(pallet_vesting::Call::vest_other{..}) |
// Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer`
Call::Utility(..) |
Call::Identity(..) |
Call::Proxy(..) |
Call::Multisig(..) |
Call::Registrar(paras_registrar::Call::register {..}) |
Call::Registrar(paras_registrar::Call::deregister {..}) |
RuntimeCall::Utility(..) |
RuntimeCall::Identity(..) |
RuntimeCall::Proxy(..) |
RuntimeCall::Multisig(..) |
RuntimeCall::Registrar(paras_registrar::Call::register {..}) |
RuntimeCall::Registrar(paras_registrar::Call::deregister {..}) |
// Specifically omitting Registrar `swap`
Call::Registrar(paras_registrar::Call::reserve {..}) |
Call::Crowdloan(..) |
Call::Slots(..) |
Call::Auctions(..) | // Specifically omitting the entire XCM Pallet
Call::VoterList(..) |
Call::NominationPools(..)
),
ProxyType::Governance => matches!(
c,
Call::Democracy(..) |
Call::Council(..) | Call::TechnicalCommittee(..) |
Call::PhragmenElection(..) |
Call::Treasury(..) | Call::Bounties(..) |
Call::Tips(..) | Call::Utility(..) |
Call::ChildBounties(..)
RuntimeCall::Registrar(paras_registrar::Call::reserve {..}) |
RuntimeCall::Crowdloan(..) |
RuntimeCall::Slots(..) |
RuntimeCall::Auctions(..) | // Specifically omitting the entire XCM Pallet
RuntimeCall::VoterList(..) |
RuntimeCall::NominationPools(..)
),
ProxyType::Governance =>
matches!(
c,
RuntimeCall::Democracy(..) |
RuntimeCall::Council(..) | RuntimeCall::TechnicalCommittee(..) |
RuntimeCall::PhragmenElection(..) |
RuntimeCall::Treasury(..) |
RuntimeCall::Bounties(..) |
RuntimeCall::Tips(..) | RuntimeCall::Utility(..) |
RuntimeCall::ChildBounties(..)
),
ProxyType::Staking => {
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..))
matches!(
c,
RuntimeCall::Staking(..) | RuntimeCall::Session(..) | RuntimeCall::Utility(..)
)
},
ProxyType::IdentityJudgement => matches!(
c,
Call::Identity(pallet_identity::Call::provide_judgement { .. }) | Call::Utility(..)
RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) |
RuntimeCall::Utility(..)
),
ProxyType::CancelProxy => {
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. }))
matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }))
},
ProxyType::Auction => matches!(
c,
Call::Auctions(..) | Call::Crowdloan(..) | Call::Registrar(..) | Call::Slots(..)
RuntimeCall::Auctions(..) |
RuntimeCall::Crowdloan(..) |
RuntimeCall::Registrar(..) |
RuntimeCall::Slots(..)
),
}
}
@@ -1169,8 +1177,8 @@ impl InstanceFilter<Call> 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;
@@ -1196,7 +1204,7 @@ impl parachains_session_info::Config for Runtime {
}
impl parachains_inclusion::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DisputesHandler = ParasDisputes;
type RewardValidators = parachains_reward_points::RewardValidatorsWithEraPoints<Runtime>;
}
@@ -1206,7 +1214,7 @@ parameter_types! {
}
impl parachains_paras::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::runtime_parachains_paras::WeightInfo<Runtime>;
type UnsignedPriority = ParasUnsignedPriority;
type NextSessionRotation = Babe;
@@ -1217,7 +1225,7 @@ parameter_types! {
}
impl parachains_ump::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type UmpSink =
crate::parachains_ump::XcmSink<xcm_executor::XcmExecutor<xcm_config::XcmConfig>, Runtime>;
type FirstMessageFactorPercent = FirstMessageFactorPercent;
@@ -1228,7 +1236,7 @@ impl parachains_ump::Config for Runtime {
impl parachains_dmp::Config for Runtime {}
impl parachains_hrmp::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Currency = Balances;
type WeightInfo = weights::runtime_parachains_hrmp::WeightInfo<Self>;
@@ -1247,7 +1255,7 @@ impl parachains_initializer::Config for Runtime {
}
impl parachains_disputes::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type RewardValidators = ();
type PunishValidators = ();
type WeightInfo = weights::runtime_parachains_disputes::WeightInfo<Runtime>;
@@ -1261,7 +1269,7 @@ parameter_types! {
}
impl paras_registrar::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Currency = Balances;
type OnSwap = (Crowdloan, Slots);
@@ -1282,7 +1290,7 @@ parameter_types! {
}
impl slots::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type Registrar = Registrar;
type LeasePeriod = LeasePeriod;
@@ -1304,7 +1312,7 @@ parameter_types! {
}
impl crowdloan::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type PalletId = CrowdloanId;
type SubmissionDeposit = SubmissionDeposit;
type MinContribution = MinContribution;
@@ -1329,7 +1337,7 @@ type AuctionInitiate = EitherOfDiverse<
>;
impl auctions::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Leaser = Slots;
type Registrar = Registrar;
type EndingPeriod = EndingPeriod;
@@ -1346,7 +1354,7 @@ parameter_types! {
}
impl pallet_nomination_pools::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type CurrencyBalance = Balance;
type RewardCounter = FixedU128;
@@ -1507,7 +1515,8 @@ pub type SignedExtra = (
claims::PrevalidateAttests<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Runtime,
@@ -1518,7 +1527,7 @@ pub type Executive = frame_executive::Executive<
(InitiateNominationPools, pallet_nomination_pools::migration::v3::MigrateToV3<Runtime>),
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
@@ -1694,7 +1703,7 @@ sp_api::impl_runtime_apis! {
fn candidate_events() -> Vec<CandidateEvent<Hash>> {
parachains_runtime_api_impl::candidate_events::<Runtime, _>(|ev| {
match ev {
Event::ParaInclusion(ev) => {
RuntimeEvent::ParaInclusion(ev) => {
Some(ev)
}
_ => None,
@@ -1920,13 +1929,13 @@ sp_api::impl_runtime_apis! {
}
}
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, Call>
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
for Runtime
{
fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo<Balance> {
fn query_call_info(call: RuntimeCall, len: u32) -> RuntimeDispatchInfo<Balance> {
TransactionPayment::query_call_info(call, len)
}
fn query_call_fee_details(call: Call, len: u32) -> FeeDetails<Balance> {
fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_call_fee_details(call, len)
}
}
@@ -2079,8 +2088,8 @@ mod test_fees {
};
let info = call.get_dispatch_info();
println!("call = {:?} / info = {:?}", call, info);
// convert to outer call.
let call = Call::Balances(call);
// convert to runtime call.
let call = RuntimeCall::Balances(call);
let extra: SignedExtra = (
frame_system::CheckNonZeroSender::<Runtime>::new(),
frame_system::CheckSpecVersion::<Runtime>::new(),
@@ -2204,9 +2213,9 @@ mod test {
#[test]
fn call_size() {
assert!(
core::mem::size_of::<Call>() <= 230,
"size of Call is more than 230 bytes: some calls have too big arguments, use Box to \
reduce the size of Call.
core::mem::size_of::<RuntimeCall>() <= 230,
"size of RuntimeCall is more than 230 bytes: some calls have too big arguments, use Box to \
reduce the size of RuntimeCall.
If the limit is too strong, maybe consider increase the limit",
);
}
@@ -2266,7 +2275,7 @@ mod multiplier_tests {
println!("calling {:?}", call);
let info = call.get_dispatch_info();
// convert to outer call.
let call = Call::System(call);
let call = RuntimeCall::System(call);
let len = call.using_encoded(|e| e.len()) as u32;
let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default()
+7 -7
View File
@@ -17,8 +17,8 @@
//! XCM configuration for Polkadot.
use super::{
parachains_origin, AccountId, Balances, Call, CouncilCollective, Event, Origin, ParaId,
Runtime, WeightToFee, XcmPallet,
parachains_origin, AccountId, Balances, CouncilCollective, Origin, ParaId, Runtime,
RuntimeCall, RuntimeEvent, WeightToFee, XcmPallet,
};
use frame_support::{
match_types, parameter_types,
@@ -132,7 +132,7 @@ pub type Barrier = (
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type Call = Call;
type RuntimeCall = RuntimeCall;
type XcmSender = XcmRouter;
type AssetTransactor = LocalAssetTransactor;
type OriginConverter = LocalOriginConverter;
@@ -141,7 +141,7 @@ impl xcm_executor::Config for XcmConfig {
type IsTeleporter = TrustedTeleporters;
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
type Weigher = FixedWeightBounds<BaseXcmWeight, RuntimeCall, MaxInstructions>;
// The weight trader piggybacks on the existing transaction-fee conversion logic.
type Trader = UsingComponents<WeightToFee, DotLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = XcmPallet;
@@ -174,7 +174,7 @@ pub type LocalOriginToLocation = (
);
impl pallet_xcm::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
// Only allow the council to send messages.
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<Origin, CouncilToPlurality>;
type XcmRouter = XcmRouter;
@@ -185,10 +185,10 @@ impl pallet_xcm::Config for Runtime {
type XcmExecutor = xcm_executor::XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything; // == Allow All
type XcmReserveTransferFilter = Everything; // == Allow All
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
type Weigher = FixedWeightBounds<BaseXcmWeight, RuntimeCall, MaxInstructions>;
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = AdvertisedXcmVersion;
}
+125 -121
View File
@@ -132,8 +132,8 @@ pub fn native_version() -> NativeVersion {
/// We currently allow all calls.
pub struct BaseFilter;
impl Contains<Call> for BaseFilter {
fn contains(_call: &Call) -> bool {
impl Contains<RuntimeCall> for BaseFilter {
fn contains(_call: &RuntimeCall) -> bool {
true
}
}
@@ -149,7 +149,7 @@ impl frame_system::Config for Runtime {
type BlockLength = BlockLength;
type DbWeight = RocksDbWeight;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = Nonce;
type BlockNumber = BlockNumber;
type Hash = Hash;
@@ -157,7 +157,7 @@ impl frame_system::Config for Runtime {
type AccountId = AccountId;
type Lookup = AccountIdLookup<AccountId, ()>;
type Header = generic::Header<BlockNumber, BlakeTwo256>;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type Version = Version;
type PalletInfo = PalletInfo;
@@ -206,10 +206,10 @@ impl PrivilegeCmp<OriginCaller> for OriginPrivilegeCmp {
}
impl pallet_scheduler::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type PalletsOrigin = OriginCaller;
type Call = Call;
type RuntimeCall = RuntimeCall;
type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = ScheduleOrigin;
type MaxScheduledPerBlock = MaxScheduledPerBlock;
@@ -227,7 +227,7 @@ parameter_types! {
impl pallet_preimage::Config for Runtime {
type WeightInfo = weights::pallet_preimage::WeightInfo<Runtime>;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type ManagerOrigin = EnsureRoot<AccountId>;
type MaxSize = PreimageMaxSize;
@@ -277,7 +277,7 @@ impl pallet_indices::Config for Runtime {
type AccountIndex = AccountIndex;
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_indices::WeightInfo<Runtime>;
}
@@ -290,7 +290,7 @@ parameter_types! {
impl pallet_balances::Config for Runtime {
type Balance = Balance;
type DustRemoval = ();
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type MaxLocks = MaxLocks;
@@ -307,7 +307,7 @@ parameter_types! {
}
impl pallet_transaction_payment::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction = CurrencyAdapter<Balances, ToAuthor<Runtime>>;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type WeightToFee = WeightToFee;
@@ -357,7 +357,7 @@ impl sp_runtime::traits::Convert<AccountId, Option<AccountId>> for ValidatorIdOf
}
impl pallet_session::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ValidatorId = AccountId;
type ValidatorIdOf = ValidatorIdOf;
type ShouldEndSession = Babe;
@@ -398,8 +398,8 @@ parameter_types! {
}
impl pallet_democracy::Config for Runtime {
type Proposal = Call;
type Event = Event;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type EnactmentPeriod = EnactmentPeriod;
type VoteLockingPeriod = EnactmentPeriod;
@@ -459,8 +459,8 @@ parameter_types! {
type CouncilCollective = pallet_collective::Instance1;
impl pallet_collective::Config<CouncilCollective> for Runtime {
type Origin = Origin;
type Proposal = Call;
type Event = Event;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type MotionDuration = CouncilMotionDuration;
type MaxProposals = CouncilMaxProposals;
type MaxMembers = CouncilMaxMembers;
@@ -487,7 +487,7 @@ parameter_types! {
const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get());
impl pallet_elections_phragmen::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type ChangeMembers = Council;
type InitializeMembers = Council;
@@ -515,8 +515,8 @@ parameter_types! {
type TechnicalCollective = pallet_collective::Instance2;
impl pallet_collective::Config<TechnicalCollective> for Runtime {
type Origin = Origin;
type Proposal = Call;
type Event = Event;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type MotionDuration = TechnicalMotionDuration;
type MaxProposals = TechnicalMaxProposals;
type MaxMembers = TechnicalMaxMembers;
@@ -530,7 +530,7 @@ type MoreThanHalfCouncil = EitherOfDiverse<
>;
impl pallet_membership::Config<pallet_membership::Instance1> for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type AddOrigin = MoreThanHalfCouncil;
type RemoveOrigin = MoreThanHalfCouncil;
type SwapOrigin = MoreThanHalfCouncil;
@@ -571,7 +571,7 @@ impl pallet_treasury::Config for Runtime {
type Currency = Balances;
type ApproveOrigin = ApproveOrigin;
type RejectOrigin = MoreThanHalfCouncil;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type OnSlash = Treasury;
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ProposalBondMinimum;
@@ -606,7 +606,7 @@ impl pallet_bounties::Config for Runtime {
type BountyValueMinimum = BountyValueMinimum;
type ChildBountyManager = ChildBounties;
type DataDepositPerByte = DataDepositPerByte;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type MaximumReasonLength = MaximumReasonLength;
type WeightInfo = weights::pallet_bounties::WeightInfo<Runtime>;
}
@@ -617,7 +617,7 @@ parameter_types! {
}
impl pallet_child_bounties::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type MaxActiveChildBountyCount = MaxActiveChildBountyCount;
type ChildBountyValueMinimum = ChildBountyValueMinimum;
type WeightInfo = weights::pallet_child_bounties::WeightInfo<Runtime>;
@@ -630,12 +630,12 @@ impl pallet_tips::Config for Runtime {
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_tips::WeightInfo<Runtime>;
}
impl pallet_offences::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = ();
}
@@ -650,7 +650,7 @@ parameter_types! {
impl pallet_im_online::Config for Runtime {
type AuthorityId = ImOnlineId;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ValidatorSet = Historical;
type NextSessionRotation = Babe;
type ReportUnresponsiveness = Offences;
@@ -662,8 +662,7 @@ impl pallet_im_online::Config for Runtime {
}
impl pallet_grandpa::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type KeyOwnerProof =
<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
@@ -689,14 +688,14 @@ impl pallet_grandpa::Config for Runtime {
/// format of the chain.
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime
where
Call: From<LocalCall>,
RuntimeCall: From<LocalCall>,
{
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
call: Call,
call: RuntimeCall,
public: <Signature as Verify>::Signer,
account: AccountId,
nonce: <Runtime as frame_system::Config>::Index,
) -> Option<(Call, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
use sp_runtime::traits::StaticLookup;
// take the biggest period possible.
let period =
@@ -740,10 +739,10 @@ impl frame_system::offchain::SigningTypes for Runtime {
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime
where
Call: From<C>,
RuntimeCall: From<C>,
{
type Extrinsic = UncheckedExtrinsic;
type OverarchingCall = Call;
type OverarchingCall = RuntimeCall;
}
parameter_types! {
@@ -751,7 +750,7 @@ parameter_types! {
}
impl claims::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type VestingSchedule = Vesting;
type Prefix = Prefix;
type MoveClaimOrigin =
@@ -770,7 +769,7 @@ parameter_types! {
}
impl pallet_identity::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BasicDeposit = BasicDeposit;
type FieldDeposit = FieldDeposit;
@@ -785,8 +784,8 @@ impl pallet_identity::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<Runtime>;
}
@@ -800,8 +799,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;
@@ -817,9 +816,9 @@ parameter_types! {
}
impl pallet_recovery::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
type Call = Call;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type ConfigDepositBase = ConfigDepositBase;
type FriendDepositFactor = FriendDepositFactor;
@@ -840,7 +839,7 @@ parameter_types! {
}
impl pallet_society::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>;
type CandidateDeposit = CandidateDeposit;
@@ -863,7 +862,7 @@ parameter_types! {
}
impl pallet_vesting::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
@@ -910,83 +909,87 @@ impl Default for ProxyType {
Self::Any
}
}
impl InstanceFilter<Call> for ProxyType {
fn filter(&self, c: &Call) -> bool {
impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
match self {
ProxyType::Any => true,
ProxyType::NonTransfer => matches!(
c,
Call::System(..) |
Call::Babe(..) |
Call::Timestamp(..) |
Call::Indices(pallet_indices::Call::claim {..}) |
Call::Indices(pallet_indices::Call::free {..}) |
Call::Indices(pallet_indices::Call::freeze {..}) |
RuntimeCall::System(..) |
RuntimeCall::Babe(..) |
RuntimeCall::Timestamp(..) |
RuntimeCall::Indices(pallet_indices::Call::claim {..}) |
RuntimeCall::Indices(pallet_indices::Call::free {..}) |
RuntimeCall::Indices(pallet_indices::Call::freeze {..}) |
// Specifically omitting Indices `transfer`, `force_transfer`
// Specifically omitting the entire Balances pallet
Call::Authorship(..) |
Call::Session(..) |
Call::Grandpa(..) |
Call::ImOnline(..) |
Call::Democracy(..) |
Call::Council(..) |
Call::TechnicalCommittee(..) |
Call::PhragmenElection(..) |
Call::TechnicalMembership(..) |
Call::Treasury(..) |
Call::Bounties(..) |
Call::ChildBounties(..) |
Call::Tips(..) |
Call::Claims(..) |
Call::Utility(..) |
Call::Identity(..) |
Call::Society(..) |
Call::Recovery(pallet_recovery::Call::as_recovered {..}) |
Call::Recovery(pallet_recovery::Call::vouch_recovery {..}) |
Call::Recovery(pallet_recovery::Call::claim_recovery {..}) |
Call::Recovery(pallet_recovery::Call::close_recovery {..}) |
Call::Recovery(pallet_recovery::Call::remove_recovery {..}) |
Call::Recovery(pallet_recovery::Call::cancel_recovered {..}) |
RuntimeCall::Authorship(..) |
RuntimeCall::Session(..) |
RuntimeCall::Grandpa(..) |
RuntimeCall::ImOnline(..) |
RuntimeCall::Democracy(..) |
RuntimeCall::Council(..) |
RuntimeCall::TechnicalCommittee(..) |
RuntimeCall::PhragmenElection(..) |
RuntimeCall::TechnicalMembership(..) |
RuntimeCall::Treasury(..) |
RuntimeCall::Bounties(..) |
RuntimeCall::ChildBounties(..) |
RuntimeCall::Tips(..) |
RuntimeCall::Claims(..) |
RuntimeCall::Utility(..) |
RuntimeCall::Identity(..) |
RuntimeCall::Society(..) |
RuntimeCall::Recovery(pallet_recovery::Call::as_recovered {..}) |
RuntimeCall::Recovery(pallet_recovery::Call::vouch_recovery {..}) |
RuntimeCall::Recovery(pallet_recovery::Call::claim_recovery {..}) |
RuntimeCall::Recovery(pallet_recovery::Call::close_recovery {..}) |
RuntimeCall::Recovery(pallet_recovery::Call::remove_recovery {..}) |
RuntimeCall::Recovery(pallet_recovery::Call::cancel_recovered {..}) |
// Specifically omitting Recovery `create_recovery`, `initiate_recovery`
Call::Vesting(pallet_vesting::Call::vest {..}) |
Call::Vesting(pallet_vesting::Call::vest_other {..}) |
RuntimeCall::Vesting(pallet_vesting::Call::vest {..}) |
RuntimeCall::Vesting(pallet_vesting::Call::vest_other {..}) |
// Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer`
Call::Scheduler(..) |
Call::Proxy(..) |
Call::Multisig(..) |
Call::Gilt(..) |
Call::Registrar(paras_registrar::Call::register {..}) |
Call::Registrar(paras_registrar::Call::deregister {..}) |
RuntimeCall::Scheduler(..) |
RuntimeCall::Proxy(..) |
RuntimeCall::Multisig(..) |
RuntimeCall::Gilt(..) |
RuntimeCall::Registrar(paras_registrar::Call::register {..}) |
RuntimeCall::Registrar(paras_registrar::Call::deregister {..}) |
// Specifically omitting Registrar `swap`
Call::Registrar(paras_registrar::Call::reserve {..}) |
Call::Crowdloan(..) |
Call::Slots(..) |
Call::Auctions(..) // Specifically omitting the entire XCM Pallet
),
ProxyType::Governance => matches!(
c,
Call::Democracy(..) |
Call::Council(..) | Call::TechnicalCommittee(..) |
Call::PhragmenElection(..) |
Call::Treasury(..) | Call::Bounties(..) |
Call::Tips(..) | Call::Utility(..) |
Call::ChildBounties(..)
RuntimeCall::Registrar(paras_registrar::Call::reserve {..}) |
RuntimeCall::Crowdloan(..) |
RuntimeCall::Slots(..) |
RuntimeCall::Auctions(..) // Specifically omitting the entire XCM Pallet
),
ProxyType::Governance =>
matches!(
c,
RuntimeCall::Democracy(..) |
RuntimeCall::Council(..) | RuntimeCall::TechnicalCommittee(..) |
RuntimeCall::PhragmenElection(..) |
RuntimeCall::Treasury(..) |
RuntimeCall::Bounties(..) |
RuntimeCall::Tips(..) | RuntimeCall::Utility(..) |
RuntimeCall::ChildBounties(..)
),
ProxyType::IdentityJudgement => matches!(
c,
Call::Identity(pallet_identity::Call::provide_judgement { .. }) | Call::Utility(..)
RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) |
RuntimeCall::Utility(..)
),
ProxyType::CancelProxy => {
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. }))
matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }))
},
ProxyType::Auction => matches!(
c,
Call::Auctions { .. } |
Call::Crowdloan { .. } |
Call::Registrar { .. } |
Call::Multisig(..) | Call::Slots { .. }
RuntimeCall::Auctions { .. } |
RuntimeCall::Crowdloan { .. } |
RuntimeCall::Registrar { .. } |
RuntimeCall::Multisig(..) |
RuntimeCall::Slots { .. }
),
ProxyType::Society => matches!(c, Call::Society(..)),
ProxyType::Society => matches!(c, RuntimeCall::Society(..)),
}
}
fn is_superset(&self, o: &Self) -> bool {
@@ -1001,8 +1004,8 @@ impl InstanceFilter<Call> 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;
@@ -1035,7 +1038,7 @@ impl runtime_parachains::inclusion::RewardValidators for RewardValidators {
}
impl parachains_inclusion::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DisputesHandler = ParasDisputes;
type RewardValidators = RewardValidators;
}
@@ -1045,7 +1048,7 @@ parameter_types! {
}
impl parachains_paras::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::runtime_parachains_paras::WeightInfo<Runtime>;
type UnsignedPriority = ParasUnsignedPriority;
type NextSessionRotation = Babe;
@@ -1056,7 +1059,7 @@ parameter_types! {
}
impl parachains_ump::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type UmpSink =
crate::parachains_ump::XcmSink<xcm_executor::XcmExecutor<xcm_config::XcmConfig>, Runtime>;
type FirstMessageFactorPercent = FirstMessageFactorPercent;
@@ -1067,7 +1070,7 @@ impl parachains_ump::Config for Runtime {
impl parachains_dmp::Config for Runtime {}
impl parachains_hrmp::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Currency = Balances;
type WeightInfo = weights::runtime_parachains_hrmp::WeightInfo<Runtime>;
@@ -1086,7 +1089,7 @@ impl parachains_initializer::Config for Runtime {
}
impl parachains_disputes::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type RewardValidators = ();
type PunishValidators = ();
type WeightInfo = weights::runtime_parachains_disputes::WeightInfo<Runtime>;
@@ -1097,7 +1100,7 @@ parameter_types! {
}
impl paras_registrar::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Currency = Balances;
type OnSwap = (Crowdloan, Slots);
@@ -1111,7 +1114,7 @@ parameter_types! {
}
impl slots::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type Registrar = Registrar;
type LeasePeriod = LeasePeriod;
@@ -1130,7 +1133,7 @@ parameter_types! {
}
impl crowdloan::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type PalletId = CrowdloanId;
type SubmissionDeposit = SubmissionDeposit;
type MinContribution = MinContribution;
@@ -1155,7 +1158,7 @@ type AuctionInitiate = EitherOfDiverse<
>;
impl auctions::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Leaser = Slots;
type Registrar = Registrar;
type EndingPeriod = EndingPeriod;
@@ -1177,7 +1180,7 @@ parameter_types! {
}
impl pallet_gilt::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type CurrencyBalance = Balance;
type AdminOrigin = MoreThanHalfCouncil;
@@ -1261,7 +1264,7 @@ parameter_types! {
}
impl assigned_slots::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type AssignSlotOrigin = EnsureRoot<AccountId>;
type Leaser = Slots;
type PermanentSlotLeasePeriodLength = PermanentSlotLeasePeriodLength;
@@ -1272,13 +1275,13 @@ impl assigned_slots::Config for Runtime {
}
impl validator_manager::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type PrivilegedOrigin = EnsureRoot<AccountId>;
}
impl pallet_sudo::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
}
construct_runtime! {
@@ -1422,7 +1425,8 @@ pub type SignedExtra = (
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Runtime,
@@ -1432,7 +1436,7 @@ pub type Executive = frame_executive::Executive<
AllPalletsWithSystem,
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
@@ -1599,7 +1603,7 @@ sp_api::impl_runtime_apis! {
fn candidate_events() -> Vec<CandidateEvent<Hash>> {
parachains_runtime_api_impl::candidate_events::<Runtime, _>(|ev| {
match ev {
Event::ParaInclusion(ev) => {
RuntimeEvent::ParaInclusion(ev) => {
Some(ev)
}
_ => None,
@@ -1926,7 +1930,7 @@ sp_api::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()))
@@ -37,7 +37,7 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config + pallet_session::Config {
/// The overreaching event type.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// Privileged origin that can add or remove validators.
type PrivilegedOrigin: EnsureOrigin<<Self as frame_system::Config>::Origin>;
+11 -8
View File
@@ -17,8 +17,8 @@
//! XCM configuration for Rococo.
use super::{
parachains_origin, AccountId, Balances, Call, CouncilCollective, Event, Origin, ParaId,
Runtime, WeightToFee, XcmPallet,
parachains_origin, AccountId, Balances, CouncilCollective, Origin, ParaId, Runtime,
RuntimeCall, RuntimeEvent, WeightToFee, XcmPallet,
};
use frame_support::{match_types, parameter_types, traits::Everything};
use runtime_common::{xcm_sender, ToAuthor};
@@ -145,7 +145,7 @@ pub type Barrier = (
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type Call = Call;
type RuntimeCall = RuntimeCall;
type XcmSender = XcmRouter;
type AssetTransactor = LocalAssetTransactor;
type OriginConverter = LocalOriginConverter;
@@ -153,8 +153,11 @@ impl xcm_executor::Config for XcmConfig {
type IsTeleporter = TrustedTeleporters;
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher =
WeightInfoBounds<crate::weights::xcm::RococoXcmWeight<Call>, Call, MaxInstructions>;
type Weigher = WeightInfoBounds<
crate::weights::xcm::RococoXcmWeight<RuntimeCall>,
RuntimeCall,
MaxInstructions,
>;
// The weight trader piggybacks on the existing transaction-fee conversion logic.
type Trader = UsingComponents<WeightToFee, RocLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = XcmPallet;
@@ -188,7 +191,7 @@ pub type LocalOriginToLocation = (
SignedToAccountId32<Origin, AccountId, RococoNetwork>,
);
impl pallet_xcm::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<Origin, LocalOriginToLocation>;
type XcmRouter = XcmRouter;
// Anyone can execute XCM messages locally.
@@ -200,10 +203,10 @@ impl pallet_xcm::Config for Runtime {
// Anyone is able to use reserve transfers regardless of who they are and what they want to
// transfer.
type XcmReserveTransferFilter = Everything;
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
type Weigher = FixedWeightBounds<BaseXcmWeight, RuntimeCall, MaxInstructions>;
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}
+37 -37
View File
@@ -137,7 +137,7 @@ impl frame_system::Config for Runtime {
type BlockLength = BlockLength;
type DbWeight = ();
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = Nonce;
type BlockNumber = BlockNumber;
type Hash = HashT;
@@ -145,7 +145,7 @@ impl frame_system::Config for Runtime {
type AccountId = AccountId;
type Lookup = Indices;
type Header = generic::Header<BlockNumber, BlakeTwo256>;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type Version = Version;
type PalletInfo = PalletInfo;
@@ -160,9 +160,9 @@ impl frame_system::Config for Runtime {
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime
where
Call: From<C>,
RuntimeCall: From<C>,
{
type OverarchingCall = Call;
type OverarchingCall = RuntimeCall;
type Extrinsic = UncheckedExtrinsic;
}
@@ -206,7 +206,7 @@ impl pallet_indices::Config for Runtime {
type AccountIndex = AccountIndex;
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
}
@@ -219,7 +219,7 @@ parameter_types! {
impl pallet_balances::Config for Runtime {
type Balance = Balance;
type DustRemoval = ();
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type MaxLocks = MaxLocks;
@@ -236,7 +236,7 @@ parameter_types! {
}
impl pallet_transaction_payment::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction = CurrencyAdapter<Balances, ()>;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type WeightToFee = WeightToFee;
@@ -282,7 +282,7 @@ impl_opaque_keys! {
}
impl pallet_session::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ValidatorId = AccountId;
type ValidatorIdOf = pallet_staking::StashOf<Self>;
type ShouldEndSession = Babe;
@@ -337,7 +337,7 @@ impl pallet_staking::Config for Runtime {
type UnixTime = Timestamp;
type CurrencyToVote = frame_support::traits::U128CurrencyToVote;
type RewardRemainder = ();
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Slash = ();
type Reward = ();
type SessionsPerEra = SessionsPerEra;
@@ -362,8 +362,7 @@ impl pallet_staking::Config for Runtime {
}
impl pallet_grandpa::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type KeyOwnerProofSystem = ();
@@ -383,14 +382,14 @@ impl pallet_grandpa::Config for Runtime {
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime
where
Call: From<LocalCall>,
RuntimeCall: From<LocalCall>,
{
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
call: Call,
call: RuntimeCall,
public: <Signature as Verify>::Signer,
account: AccountId,
nonce: <Runtime as frame_system::Config>::Index,
) -> Option<(Call, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
let period =
BlockHashCount::get().checked_next_power_of_two().map(|c| c / 2).unwrap_or(2) as u64;
@@ -427,7 +426,7 @@ impl frame_system::offchain::SigningTypes for Runtime {
}
impl pallet_offences::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = Staking;
}
@@ -446,7 +445,7 @@ parameter_types! {
}
impl claims::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type VestingSchedule = Vesting;
type Prefix = Prefix;
type MoveClaimOrigin = frame_system::EnsureRoot<AccountId>;
@@ -458,7 +457,7 @@ parameter_types! {
}
impl pallet_vesting::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
@@ -467,8 +466,8 @@ impl pallet_vesting::Config for Runtime {
}
impl pallet_sudo::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
}
impl parachains_configuration::Config for Runtime {
@@ -478,13 +477,13 @@ impl parachains_configuration::Config for Runtime {
impl parachains_shared::Config for Runtime {}
impl parachains_inclusion::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DisputesHandler = ParasDisputes;
type RewardValidators = RewardValidatorsWithEraPoints<Runtime>;
}
impl parachains_disputes::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type RewardValidators = ();
type PunishValidators = ();
type WeightInfo = parachains_disputes::TestWeightInfo;
@@ -509,7 +508,7 @@ parameter_types! {
}
impl parachains_paras::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = parachains_paras::TestWeightInfo;
type UnsignedPriority = ParasUnsignedPriority;
type NextSessionRotation = Babe;
@@ -522,7 +521,7 @@ parameter_types! {
}
impl parachains_ump::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type UmpSink = ();
type FirstMessageFactorPercent = FirstMessageFactorPercent;
type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;
@@ -540,24 +539,24 @@ pub type LocalOriginToLocation = xcm_builder::SignedToAccountId32<Origin, Accoun
impl pallet_xcm::Config for Runtime {
// The config types here are entirely configurable, since the only one that is sorely needed
// is `XcmExecutor`, which will be used in unit tests located in xcm-executor.
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin<Origin, LocalOriginToLocation>;
type LocationInverter = xcm_config::InvertNothing;
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<Origin, LocalOriginToLocation>;
type Weigher = xcm_builder::FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
type Weigher = xcm_builder::FixedWeightBounds<BaseXcmWeight, RuntimeCall, MaxInstructions>;
type XcmRouter = xcm_config::DoNothingRouter;
type XcmExecuteFilter = Everything;
type XcmExecutor = xcm_executor::XcmExecutor<xcm_config::XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = Everything;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}
impl parachains_hrmp::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Currency = Balances;
type WeightInfo = parachains_hrmp::TestWeightInfo;
@@ -570,9 +569,9 @@ impl paras_sudo_wrapper::Config for Runtime {}
impl parachains_origin::Config for Runtime {}
impl pallet_test_notifier::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
}
#[frame_support::pallet]
@@ -589,10 +588,10 @@ pub mod pallet_test_notifier {
#[pallet::config]
pub trait Config: frame_system::Config + pallet_xcm::Config {
type Event: IsType<<Self as frame_system::Config>::Event> + From<Event<Self>>;
type RuntimeEvent: IsType<<Self as frame_system::Config>::RuntimeEvent> + From<Event<Self>>;
type Origin: IsType<<Self as frame_system::Config>::Origin>
+ Into<Result<pallet_xcm::Origin, <Self as Config>::Origin>>;
type Call: IsType<<Self as pallet_xcm::Config>::Call> + From<Call<Self>>;
type RuntimeCall: IsType<<Self as pallet_xcm::Config>::RuntimeCall> + From<Call<Self>>;
}
#[pallet::event]
@@ -635,7 +634,7 @@ pub mod pallet_test_notifier {
Call::<T>::notification_received { query_id: 0, response: Default::default() };
let qid = pallet_xcm::Pallet::<T>::new_notify_query(
Junction::AccountId32 { network: Any, id }.into(),
<T as Config>::Call::from(call),
<T as Config>::RuntimeCall::from(call),
100u32.into(),
);
Self::deposit_event(Event::<T>::NotifyQueryPrepared(qid));
@@ -732,7 +731,8 @@ pub type SignedExtra = (
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Runtime,
@@ -742,7 +742,7 @@ pub type Executive = frame_executive::Executive<
AllPalletsWithSystem,
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
pub type Hash = <Block as BlockT>::Hash;
pub type Extrinsic = <Block as BlockT>::Extrinsic;
@@ -1061,13 +1061,13 @@ sp_api::impl_runtime_apis! {
}
}
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, Call>
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
for Runtime
{
fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo<Balance> {
fn query_call_info(call: RuntimeCall, len: u32) -> RuntimeDispatchInfo<Balance> {
TransactionPayment::query_call_info(call, len)
}
fn query_call_fee_details(call: Call, len: u32) -> FeeDetails<Balance> {
fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_call_fee_details(call, len)
}
}
@@ -78,7 +78,7 @@ impl InvertLocation for InvertNothing {
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type Call = super::Call;
type RuntimeCall = super::RuntimeCall;
type XcmSender = DoNothingRouter;
type AssetTransactor = DummyAssetTransactor;
type OriginConverter = pallet_xcm::XcmPassthrough<super::Origin>;
@@ -86,7 +86,7 @@ impl xcm_executor::Config for XcmConfig {
type IsTeleporter = ();
type LocationInverter = InvertNothing;
type Barrier = Barrier;
type Weigher = FixedWeightBounds<super::BaseXcmWeight, super::Call, MaxInstructions>;
type Weigher = FixedWeightBounds<super::BaseXcmWeight, super::RuntimeCall, MaxInstructions>;
type Trader = DummyWeightTrader;
type ResponseHandler = super::Xcm;
type AssetTrap = super::Xcm;
+99 -92
View File
@@ -139,7 +139,7 @@ impl frame_system::Config for Runtime {
type BlockWeights = BlockWeights;
type BlockLength = BlockLength;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = Nonce;
type BlockNumber = BlockNumber;
type Hash = Hash;
@@ -147,7 +147,7 @@ impl frame_system::Config for Runtime {
type AccountId = AccountId;
type Lookup = AccountIdLookup<AccountId, ()>;
type Header = generic::Header<BlockNumber, BlakeTwo256>;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type DbWeight = RocksDbWeight;
type Version = Version;
@@ -169,10 +169,10 @@ parameter_types! {
}
impl pallet_scheduler::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type PalletsOrigin = OriginCaller;
type Call = Call;
type RuntimeCall = RuntimeCall;
type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = EnsureRoot<AccountId>;
type MaxScheduledPerBlock = MaxScheduledPerBlock;
@@ -190,7 +190,7 @@ parameter_types! {
impl pallet_preimage::Config for Runtime {
type WeightInfo = weights::pallet_preimage::WeightInfo<Runtime>;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type ManagerOrigin = EnsureRoot<AccountId>;
type MaxSize = PreimageMaxSize;
@@ -245,7 +245,7 @@ impl pallet_indices::Config for Runtime {
type AccountIndex = AccountIndex;
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_indices::WeightInfo<Runtime>;
}
@@ -258,7 +258,7 @@ parameter_types! {
impl pallet_balances::Config for Runtime {
type Balance = Balance;
type DustRemoval = ();
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type MaxLocks = MaxLocks;
@@ -275,7 +275,7 @@ parameter_types! {
}
impl pallet_transaction_payment::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction = CurrencyAdapter<Balances, ToAuthor<Runtime>>;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type WeightToFee = WeightToFee;
@@ -321,7 +321,7 @@ impl_opaque_keys! {
}
impl pallet_session::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ValidatorId = AccountId;
type ValidatorIdOf = pallet_staking::StashOf<Self>;
type ShouldEndSession = Babe;
@@ -408,7 +408,7 @@ impl pallet_election_provider_multi_phase::MinerConfig for Runtime {
}
impl pallet_election_provider_multi_phase::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type EstimateCallFee = TransactionPayment;
type SignedPhase = SignedPhase;
@@ -451,7 +451,7 @@ parameter_types! {
}
impl pallet_bags_list::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ScoreProvider = Staking;
type WeightInfo = weights::pallet_bags_list::WeightInfo<Runtime>;
type BagThresholds = BagThresholds;
@@ -489,7 +489,7 @@ impl pallet_staking::Config for Runtime {
type UnixTime = Timestamp;
type CurrencyToVote = CurrencyToVote;
type RewardRemainder = ();
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Slash = ();
type Reward = ();
type SessionsPerEra = SessionsPerEra;
@@ -516,7 +516,7 @@ parameter_types! {
}
impl pallet_offences::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = Staking;
}
@@ -535,7 +535,7 @@ parameter_types! {
impl pallet_im_online::Config for Runtime {
type AuthorityId = ImOnlineId;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ValidatorSet = Historical;
type NextSessionRotation = Babe;
type ReportUnresponsiveness = Offences;
@@ -547,8 +547,7 @@ impl pallet_im_online::Config for Runtime {
}
impl pallet_grandpa::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type KeyOwnerProofSystem = Historical;
@@ -574,14 +573,14 @@ impl pallet_grandpa::Config for Runtime {
/// format of the chain.
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime
where
Call: From<LocalCall>,
RuntimeCall: From<LocalCall>,
{
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
call: Call,
call: RuntimeCall,
public: <Signature as Verify>::Signer,
account: AccountId,
nonce: <Runtime as frame_system::Config>::Index,
) -> Option<(Call, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
use sp_runtime::traits::StaticLookup;
// take the biggest period possible.
let period =
@@ -625,9 +624,9 @@ impl frame_system::offchain::SigningTypes for Runtime {
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime
where
Call: From<C>,
RuntimeCall: From<C>,
{
type OverarchingCall = Call;
type OverarchingCall = RuntimeCall;
type Extrinsic = UncheckedExtrinsic;
}
@@ -642,7 +641,7 @@ parameter_types! {
}
impl pallet_identity::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type Slashed = ();
type BasicDeposit = BasicDeposit;
@@ -657,8 +656,8 @@ impl pallet_identity::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<Runtime>;
}
@@ -672,8 +671,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;
@@ -689,9 +688,9 @@ parameter_types! {
}
impl pallet_recovery::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
type Call = Call;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type ConfigDepositBase = ConfigDepositBase;
type FriendDepositFactor = FriendDepositFactor;
@@ -704,7 +703,7 @@ parameter_types! {
}
impl pallet_vesting::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
@@ -713,8 +712,8 @@ impl pallet_vesting::Config for Runtime {
}
impl pallet_sudo::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
}
parameter_types! {
@@ -756,71 +755,78 @@ impl Default for ProxyType {
Self::Any
}
}
impl InstanceFilter<Call> for ProxyType {
fn filter(&self, c: &Call) -> bool {
impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
match self {
ProxyType::Any => true,
ProxyType::NonTransfer => matches!(
c,
Call::System(..) |
Call::Babe(..) |
Call::Timestamp(..) |
Call::Indices(pallet_indices::Call::claim{..}) |
Call::Indices(pallet_indices::Call::free{..}) |
Call::Indices(pallet_indices::Call::freeze{..}) |
RuntimeCall::System(..) |
RuntimeCall::Babe(..) |
RuntimeCall::Timestamp(..) |
RuntimeCall::Indices(pallet_indices::Call::claim{..}) |
RuntimeCall::Indices(pallet_indices::Call::free{..}) |
RuntimeCall::Indices(pallet_indices::Call::freeze{..}) |
// Specifically omitting Indices `transfer`, `force_transfer`
// Specifically omitting the entire Balances pallet
Call::Authorship(..) |
Call::Staking(..) |
Call::Session(..) |
Call::Grandpa(..) |
Call::ImOnline(..) |
Call::Utility(..) |
Call::Identity(..) |
Call::Recovery(pallet_recovery::Call::as_recovered{..}) |
Call::Recovery(pallet_recovery::Call::vouch_recovery{..}) |
Call::Recovery(pallet_recovery::Call::claim_recovery{..}) |
Call::Recovery(pallet_recovery::Call::close_recovery{..}) |
Call::Recovery(pallet_recovery::Call::remove_recovery{..}) |
Call::Recovery(pallet_recovery::Call::cancel_recovered{..}) |
RuntimeCall::Authorship(..) |
RuntimeCall::Staking(..) |
RuntimeCall::Session(..) |
RuntimeCall::Grandpa(..) |
RuntimeCall::ImOnline(..) |
RuntimeCall::Utility(..) |
RuntimeCall::Identity(..) |
RuntimeCall::Recovery(pallet_recovery::Call::as_recovered{..}) |
RuntimeCall::Recovery(pallet_recovery::Call::vouch_recovery{..}) |
RuntimeCall::Recovery(pallet_recovery::Call::claim_recovery{..}) |
RuntimeCall::Recovery(pallet_recovery::Call::close_recovery{..}) |
RuntimeCall::Recovery(pallet_recovery::Call::remove_recovery{..}) |
RuntimeCall::Recovery(pallet_recovery::Call::cancel_recovered{..}) |
// Specifically omitting Recovery `create_recovery`, `initiate_recovery`
Call::Vesting(pallet_vesting::Call::vest{..}) |
Call::Vesting(pallet_vesting::Call::vest_other{..}) |
RuntimeCall::Vesting(pallet_vesting::Call::vest{..}) |
RuntimeCall::Vesting(pallet_vesting::Call::vest_other{..}) |
// Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer`
Call::Scheduler(..) |
RuntimeCall::Scheduler(..) |
// Specifically omitting Sudo pallet
Call::Proxy(..) |
Call::Multisig(..) |
Call::Registrar(paras_registrar::Call::register{..}) |
Call::Registrar(paras_registrar::Call::deregister{..}) |
RuntimeCall::Proxy(..) |
RuntimeCall::Multisig(..) |
RuntimeCall::Registrar(paras_registrar::Call::register{..}) |
RuntimeCall::Registrar(paras_registrar::Call::deregister{..}) |
// Specifically omitting Registrar `swap`
Call::Registrar(paras_registrar::Call::reserve{..}) |
Call::Crowdloan(..) |
Call::Slots(..) |
Call::Auctions(..) | // Specifically omitting the entire XCM Pallet
Call::VoterList(..) |
Call::NominationPools(..)
RuntimeCall::Registrar(paras_registrar::Call::reserve{..}) |
RuntimeCall::Crowdloan(..) |
RuntimeCall::Slots(..) |
RuntimeCall::Auctions(..) | // Specifically omitting the entire XCM Pallet
RuntimeCall::VoterList(..) |
RuntimeCall::NominationPools(..)
),
ProxyType::Staking => {
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..))
matches!(
c,
RuntimeCall::Staking(..) | RuntimeCall::Session(..) | RuntimeCall::Utility(..)
)
},
ProxyType::SudoBalances => match c {
Call::Sudo(pallet_sudo::Call::sudo { call: ref x }) => {
matches!(x.as_ref(), &Call::Balances(..))
RuntimeCall::Sudo(pallet_sudo::Call::sudo { call: ref x }) => {
matches!(x.as_ref(), &RuntimeCall::Balances(..))
},
Call::Utility(..) => true,
RuntimeCall::Utility(..) => true,
_ => false,
},
ProxyType::IdentityJudgement => matches!(
c,
Call::Identity(pallet_identity::Call::provide_judgement { .. }) | Call::Utility(..)
RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) |
RuntimeCall::Utility(..)
),
ProxyType::CancelProxy => {
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. }))
matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }))
},
ProxyType::Auction => matches!(
c,
Call::Auctions(..) | Call::Crowdloan(..) | Call::Registrar(..) | Call::Slots(..)
RuntimeCall::Auctions(..) |
RuntimeCall::Crowdloan(..) |
RuntimeCall::Registrar(..) |
RuntimeCall::Slots(..)
),
}
}
@@ -836,8 +842,8 @@ impl InstanceFilter<Call> 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;
@@ -863,7 +869,7 @@ impl parachains_session_info::Config for Runtime {
}
impl parachains_inclusion::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DisputesHandler = ParasDisputes;
type RewardValidators = parachains_reward_points::RewardValidatorsWithEraPoints<Runtime>;
}
@@ -873,7 +879,7 @@ parameter_types! {
}
impl parachains_paras::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::runtime_parachains_paras::WeightInfo<Runtime>;
type UnsignedPriority = ParasUnsignedPriority;
type NextSessionRotation = Babe;
@@ -884,7 +890,7 @@ parameter_types! {
}
impl parachains_ump::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type UmpSink =
crate::parachains_ump::XcmSink<xcm_executor::XcmExecutor<xcm_config::XcmConfig>, Runtime>;
type FirstMessageFactorPercent = FirstMessageFactorPercent;
@@ -895,7 +901,7 @@ impl parachains_ump::Config for Runtime {
impl parachains_dmp::Config for Runtime {}
impl parachains_hrmp::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Currency = Balances;
type WeightInfo = weights::runtime_parachains_hrmp::WeightInfo<Self>;
@@ -924,7 +930,7 @@ parameter_types! {
}
impl assigned_slots::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type AssignSlotOrigin = EnsureRoot<AccountId>;
type Leaser = Slots;
type PermanentSlotLeasePeriodLength = PermanentSlotLeasePeriodLength;
@@ -935,7 +941,7 @@ impl assigned_slots::Config for Runtime {
}
impl parachains_disputes::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type RewardValidators = parachains_reward_points::RewardValidatorsWithEraPoints<Runtime>;
type PunishValidators = ();
type WeightInfo = weights::runtime_parachains_disputes::WeightInfo<Runtime>;
@@ -947,7 +953,7 @@ parameter_types! {
}
impl paras_registrar::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type Currency = Balances;
type OnSwap = (Crowdloan, Slots);
@@ -961,7 +967,7 @@ parameter_types! {
}
impl slots::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type Registrar = Registrar;
type LeasePeriod = LeasePeriod;
@@ -980,7 +986,7 @@ parameter_types! {
}
impl crowdloan::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type PalletId = CrowdloanId;
type SubmissionDeposit = SubmissionDeposit;
type MinContribution = MinContribution;
@@ -1000,7 +1006,7 @@ parameter_types! {
}
impl auctions::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Leaser = Slots;
type Registrar = Registrar;
type EndingPeriod = EndingPeriod;
@@ -1016,7 +1022,7 @@ parameter_types! {
}
impl pallet_nomination_pools::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_nomination_pools::WeightInfo<Self>;
type Currency = Balances;
type CurrencyBalance = Balance;
@@ -1147,7 +1153,8 @@ pub type SignedExtra = (
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Runtime,
@@ -1158,7 +1165,7 @@ pub type Executive = frame_executive::Executive<
pallet_nomination_pools::migration::v3::MigrateToV3<Runtime>,
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
@@ -1319,7 +1326,7 @@ sp_api::impl_runtime_apis! {
fn candidate_events() -> Vec<CandidateEvent<Hash>> {
parachains_runtime_api_impl::candidate_events::<Runtime, _>(|ev| {
match ev {
Event::ParaInclusion(ev) => {
RuntimeEvent::ParaInclusion(ev) => {
Some(ev)
}
_ => None,
@@ -1552,13 +1559,13 @@ sp_api::impl_runtime_apis! {
}
}
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, Call>
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
for Runtime
{
fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo<Balance> {
fn query_call_info(call: RuntimeCall, len: u32) -> RuntimeDispatchInfo<Balance> {
TransactionPayment::query_call_info(call, len)
}
fn query_call_fee_details(call: Call, len: u32) -> FeeDetails<Balance> {
fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_call_fee_details(call, len)
}
}
@@ -1687,7 +1694,7 @@ sp_api::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()))
+3 -3
View File
@@ -43,9 +43,9 @@ fn sample_size_is_sensible() {
#[test]
fn call_size() {
assert!(
core::mem::size_of::<Call>() <= 230,
"size of Call is more than 230 bytes: some calls have too big arguments, use Box to reduce \
the size of Call.
core::mem::size_of::<RuntimeCall>() <= 230,
"size of RuntimeCall is more than 230 bytes: some calls have too big arguments, use Box to reduce \
the size of RuntimeCall.
If the limit is too strong, maybe consider increase the limit to 300.",
);
}
@@ -72,8 +72,8 @@ impl WeighMultiAssets for MultiAssets {
}
}
pub struct WestendXcmWeight<Call>(core::marker::PhantomData<Call>);
impl<Call> XcmWeightInfo<Call> for WestendXcmWeight<Call> {
pub struct WestendXcmWeight<RuntimeCall>(core::marker::PhantomData<RuntimeCall>);
impl<RuntimeCall> XcmWeightInfo<RuntimeCall> for WestendXcmWeight<RuntimeCall> {
fn withdraw_asset(assets: &MultiAssets) -> XCMWeight {
assets.weigh_multi_assets(XcmBalancesWeight::<Runtime>::withdraw_asset())
}
@@ -99,7 +99,7 @@ impl<Call> XcmWeightInfo<Call> for WestendXcmWeight<Call> {
fn transact(
_origin_type: &OriginKind,
_require_weight_at_most: &u64,
_call: &DoubleEncoded<Call>,
_call: &DoubleEncoded<RuntimeCall>,
) -> XCMWeight {
XcmGeneric::<Runtime>::transact().ref_time()
}
@@ -179,10 +179,10 @@ impl<Call> XcmWeightInfo<Call> for WestendXcmWeight<Call> {
fn refund_surplus() -> XCMWeight {
XcmGeneric::<Runtime>::refund_surplus().ref_time()
}
fn set_error_handler(_xcm: &Xcm<Call>) -> XCMWeight {
fn set_error_handler(_xcm: &Xcm<RuntimeCall>) -> XCMWeight {
XcmGeneric::<Runtime>::set_error_handler().ref_time()
}
fn set_appendix(_xcm: &Xcm<Call>) -> XCMWeight {
fn set_appendix(_xcm: &Xcm<RuntimeCall>) -> XCMWeight {
XcmGeneric::<Runtime>::set_appendix().ref_time()
}
fn clear_error() -> XCMWeight {
+9 -7
View File
@@ -17,8 +17,8 @@
//! XCM configurations for Westend.
use super::{
parachains_origin, weights, AccountId, Balances, Call, Event, Origin, ParaId, Runtime,
WeightToFee, XcmPallet,
parachains_origin, weights, AccountId, Balances, Origin, ParaId, Runtime, RuntimeCall,
RuntimeEvent, WeightToFee, XcmPallet,
};
use frame_support::{
parameter_types,
@@ -107,7 +107,7 @@ pub type Barrier = (
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type Call = Call;
type RuntimeCall = RuntimeCall;
type XcmSender = XcmRouter;
type AssetTransactor = LocalAssetTransactor;
type OriginConverter = LocalOriginConverter;
@@ -115,7 +115,8 @@ impl xcm_executor::Config for XcmConfig {
type IsTeleporter = TrustedTeleporters;
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher = WeightInfoBounds<weights::xcm::WestendXcmWeight<Call>, Call, MaxInstructions>;
type Weigher =
WeightInfoBounds<weights::xcm::WestendXcmWeight<RuntimeCall>, RuntimeCall, MaxInstructions>;
type Trader = UsingComponents<WeightToFee, WndLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
@@ -131,7 +132,7 @@ pub type LocalOriginToLocation = (
);
impl pallet_xcm::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<Origin, LocalOriginToLocation>;
type XcmRouter = XcmRouter;
// Anyone can execute XCM messages locally...
@@ -141,10 +142,11 @@ impl pallet_xcm::Config for Runtime {
type XcmExecutor = xcm_executor::XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = Everything;
type Weigher = WeightInfoBounds<weights::xcm::WestendXcmWeight<Call>, Call, MaxInstructions>;
type Weigher =
WeightInfoBounds<weights::xcm::WestendXcmWeight<RuntimeCall>, RuntimeCall, MaxInstructions>;
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}