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
+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);