Skip to content

Commit e845a99

Browse files
committed
remove RuntimeEvent
1 parent 1367c34 commit e845a99

File tree

26 files changed

+17
-90
lines changed

26 files changed

+17
-90
lines changed

pallets/admin-utils/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ pub mod pallet {
4545
+ pallet_subtensor::pallet::Config
4646
+ pallet_evm_chain_id::pallet::Config
4747
{
48-
/// Because this pallet emits events, it depends on the runtime's definition of an event.
49-
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
50-
5148
/// Implementation of the AuraInterface
5249
type Aura: crate::AuraInterface<<Self as Config>::AuthorityId, Self::MaxAuthorities>;
5350

pallets/admin-utils/src/tests/mock.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ parameter_types! {
152152
}
153153

154154
impl pallet_subtensor::Config for Test {
155-
type RuntimeEvent = RuntimeEvent;
156155
type RuntimeCall = RuntimeCall;
157156
type Currency = Balances;
158157
type InitialIssuance = InitialIssuance;
@@ -253,7 +252,6 @@ impl pallet_crowdloan::Config for Test {
253252
type PalletId = CrowdloanPalletId;
254253
type Currency = Balances;
255254
type RuntimeCall = RuntimeCall;
256-
type RuntimeEvent = RuntimeEvent;
257255
type WeightInfo = pallet_crowdloan::weights::SubstrateWeight<Test>;
258256
type Preimages = Preimage;
259257
type MinimumDeposit = MinimumDeposit;
@@ -330,7 +328,6 @@ parameter_types! {
330328
}
331329

332330
impl pallet_subtensor_swap::Config for Test {
333-
type RuntimeEvent = RuntimeEvent;
334331
type SubnetInfo = SubtensorModule;
335332
type BalanceOps = SubtensorModule;
336333
type ProtocolId = SwapProtocolId;
@@ -361,7 +358,6 @@ impl crate::GrandpaInterface<Test> for GrandpaInterfaceImpl {
361358
}
362359

363360
impl crate::Config for Test {
364-
type RuntimeEvent = RuntimeEvent;
365361
type AuthorityId = AuraId;
366362
type MaxAuthorities = ConstU32<32>;
367363
type Aura = ();
@@ -392,7 +388,6 @@ impl pallet_scheduler::Config for Test {
392388

393389
impl pallet_evm_chain_id::Config for Test {}
394390
impl pallet_drand::Config for Test {
395-
type RuntimeEvent = RuntimeEvent;
396391
type AuthorityId = TestAuthId;
397392
type Verifier = pallet_drand::verifier::QuicknetVerifier;
398393
type UnsignedPriority = ConstU64<{ 1 << 20 }>;

pallets/collective/src/benchmarking.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const SEED: u32 = 0;
3131

3232
const MAX_BYTES: u32 = 1_024;
3333

34-
fn assert_last_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::RuntimeEvent) {
34+
fn assert_last_event<T: frame_system::pallet::Config>(generic_event: <T as frame_system::pallet::Config>::RuntimeEvent) {
3535
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
3636
}
3737

@@ -131,7 +131,7 @@ benchmarks_instance_pallet! {
131131
verify {
132132
let proposal_hash = T::Hashing::hash_of(&proposal);
133133
// Note that execution fails due to mis-matched origin
134-
assert_last_event::<T, I>(
134+
assert_last_event::<T>(
135135
Event::MemberExecuted { proposal_hash, result: Ok(()) }.into()
136136
);
137137
}
@@ -176,7 +176,7 @@ benchmarks_instance_pallet! {
176176
// New proposal is recorded
177177
assert_eq!(Collective::<T, I>::proposals().len(), p as usize);
178178
let proposal_hash = T::Hashing::hash_of(&proposal);
179-
assert_last_event::<T, I>(Event::Proposed { account: caller, proposal_index: p - 1, proposal_hash, threshold }.into());
179+
assert_last_event::<T>(Event::Proposed { account: caller, proposal_index: p - 1, proposal_hash, threshold }.into());
180180
}
181181

182182
vote {
@@ -319,7 +319,7 @@ benchmarks_instance_pallet! {
319319
verify {
320320
// The last proposal is removed.
321321
assert_eq!(Collective::<T, I>::proposals().len(), (p - 1) as usize);
322-
assert_last_event::<T, I>(Event::Disapproved { proposal_hash: last_hash }.into());
322+
assert_last_event::<T>(Event::Disapproved { proposal_hash: last_hash }.into());
323323
}
324324

325325
close_early_approved {
@@ -397,7 +397,7 @@ benchmarks_instance_pallet! {
397397
verify {
398398
// The last proposal is removed.
399399
assert_eq!(Collective::<T, I>::proposals().len(), (p - 1) as usize);
400-
assert_last_event::<T, I>(Event::Executed { proposal_hash: last_hash, result: Ok(()) }.into());
400+
assert_last_event::<T>(Event::Executed { proposal_hash: last_hash, result: Ok(()) }.into());
401401
}
402402

403403
close_disapproved {
@@ -476,7 +476,7 @@ benchmarks_instance_pallet! {
476476
}: close(SystemOrigin::Root, last_hash, index, Weight::MAX, bytes_in_storage)
477477
verify {
478478
assert_eq!(Collective::<T, I>::proposals().len(), (p - 1) as usize);
479-
assert_last_event::<T, I>(Event::Disapproved { proposal_hash: last_hash }.into());
479+
assert_last_event::<T>(Event::Disapproved { proposal_hash: last_hash }.into());
480480
}
481481

482482
close_approved {
@@ -545,7 +545,7 @@ benchmarks_instance_pallet! {
545545
}: close(SystemOrigin::Root, last_hash, p - 1, Weight::MAX, bytes_in_storage)
546546
verify {
547547
assert_eq!(Collective::<T, I>::proposals().len(), (p - 1) as usize);
548-
assert_last_event::<T, I>(Event::Executed { proposal_hash: last_hash, result: Ok(()) }.into());
548+
assert_last_event::<T>(Event::Executed { proposal_hash: last_hash, result: Ok(()) }.into());
549549
}
550550

551551
disapprove_proposal {
@@ -593,7 +593,7 @@ benchmarks_instance_pallet! {
593593
}: _(SystemOrigin::Root, last_hash)
594594
verify {
595595
assert_eq!(Collective::<T, I>::proposals().len(), (p - 1) as usize);
596-
assert_last_event::<T, I>(Event::Disapproved { proposal_hash: last_hash }.into());
596+
assert_last_event::<T>(Event::Disapproved { proposal_hash: last_hash }.into());
597597
}
598598

599599
impl_benchmark_test_suite!(Collective, crate::tests::new_test_ext(), crate::tests::Test);

pallets/collective/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,6 @@ pub mod pallet {
203203
> + From<frame_system::Call<Self>>
204204
+ GetDispatchInfo;
205205

206-
/// The runtime event type.
207-
type RuntimeEvent: From<Event<Self, I>>
208-
+ IsType<<Self as frame_system::Config>::RuntimeEvent>;
209-
210206
/// The time-out for council motions.
211207
type MotionDuration: Get<BlockNumberFor<Self>>;
212208

pallets/collective/src/tests.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ mod mock_democracy {
5555

5656
#[pallet::config]
5757
pub trait Config: frame_system::Config + Sized {
58-
type RuntimeEvent: From<Event<Self>>
59-
+ IsType<<Self as frame_system::Config>::RuntimeEvent>;
6058
type ExternalMajorityOrigin: EnsureOrigin<Self::RuntimeOrigin>;
6159
}
6260

@@ -141,7 +139,6 @@ impl Get<MemberCount> for GetCollectiveCount {
141139
impl Config<Instance1> for Test {
142140
type RuntimeOrigin = RuntimeOrigin;
143141
type Proposal = RuntimeCall;
144-
type RuntimeEvent = RuntimeEvent;
145142
type MotionDuration = ConstU64<3>;
146143
type MaxProposals = MaxProposals;
147144
type MaxMembers = MaxMembers;
@@ -182,7 +179,6 @@ impl Get<MemberCount> for GetCollectiveMajorityCount {
182179
impl Config<Instance2> for Test {
183180
type RuntimeOrigin = RuntimeOrigin;
184181
type Proposal = RuntimeCall;
185-
type RuntimeEvent = RuntimeEvent;
186182
type MotionDuration = ConstU64<3>;
187183
type MaxProposals = MaxProposals;
188184
type MaxMembers = MaxMembers;
@@ -194,7 +190,6 @@ impl Config<Instance2> for Test {
194190
type GetVotingMembers = GetCollectiveMajorityCount;
195191
}
196192
impl mock_democracy::Config for Test {
197-
type RuntimeEvent = RuntimeEvent;
198193
type ExternalMajorityOrigin = EnsureProportionAtLeast<u64, Instance1, 3, 4>;
199194
}
200195

@@ -227,7 +222,6 @@ impl Get<MemberCount> for GetDefaultCollectiveCount {
227222
impl Config for Test {
228223
type RuntimeOrigin = RuntimeOrigin;
229224
type Proposal = RuntimeCall;
230-
type RuntimeEvent = RuntimeEvent;
231225
type MotionDuration = ConstU64<3>;
232226
type MaxProposals = MaxProposals;
233227
type MaxMembers = MaxMembers;

pallets/commitments/src/benchmarking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use sp_std::vec;
1111

1212
use sp_runtime::traits::Bounded;
1313

14-
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
14+
fn assert_last_event<T: frame_system::pallet::Config>(generic_event: <T as frame_system::pallet::Config>::RuntimeEvent) {
1515
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
1616
}
1717

pallets/commitments/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ pub mod pallet {
4444
// Configure the pallet by specifying the parameters and types on which it depends.
4545
#[pallet::config]
4646
pub trait Config: frame_system::Config + pallet_drand::Config {
47-
/// Because this pallet emits events, it depends on the runtime's definition of an event.
48-
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
49-
5047
///Currency type that will be used to reserve deposits for commitments
5148
type Currency: ReservableCurrency<Self::AccountId> + Send + Sync;
5249

pallets/commitments/src/mock.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ impl pallet_commitments::CanCommit<u64> for TestCanCommit {
9494
}
9595

9696
impl pallet_commitments::Config for Test {
97-
type RuntimeEvent = RuntimeEvent;
9897
type Currency = Balances;
9998
type WeightInfo = ();
10099
type MaxFields = TestMaxFields;
@@ -118,7 +117,6 @@ impl pallet_commitments::GetTempoInterface for MockTempoInterface {
118117
}
119118

120119
impl pallet_drand::Config for Test {
121-
type RuntimeEvent = RuntimeEvent;
122120
type AuthorityId = test_crypto::TestAuthId;
123121
type Verifier = pallet_drand::verifier::QuicknetVerifier;
124122
type UnsignedPriority = ConstU64<{ 1 << 20 }>;

pallets/crowdloan/src/benchmarking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ const SEED: u32 = 0;
1616

1717
use alloc::{boxed::Box, vec};
1818

19-
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
19+
fn assert_last_event<T: frame_system::pallet::Config>(generic_event: <T as frame_system::pallet::Config>::RuntimeEvent) {
2020
let events = frame_system::Pallet::<T>::events();
21-
let system_event: <T as frame_system::Config>::RuntimeEvent = generic_event.into();
21+
let system_event: <T as frame_system::pallet::Config>::RuntimeEvent = generic_event.into();
2222
// compare to the last event record
2323
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
2424
assert_eq!(event, &system_event);

pallets/crowdloan/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ pub mod pallet {
9797
/// Configuration trait.
9898
#[pallet::config]
9999
pub trait Config: frame_system::Config {
100-
/// The overarching event type.
101-
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
102-
103100
/// The overarching call type.
104101
type RuntimeCall: Parameter
105102
+ Dispatchable<RuntimeOrigin = Self::RuntimeOrigin>

0 commit comments

Comments
 (0)