mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 12:37:57 +00:00
* 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:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user