Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 39d2e6b

Browse files
authored
remove stale polkadot call filter (#5969)
* Remove stale polkadot call filter * fix build * really fix it * unused import * Fix Co-authored-by: parity-processbot <>
1 parent 5de9b7f commit 39d2e6b

File tree

3 files changed

+6
-81
lines changed

3 files changed

+6
-81
lines changed

runtime/kusama/src/lib.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use frame_election_provider_support::{
5252
use frame_support::{
5353
construct_runtime, parameter_types,
5454
traits::{
55-
ConstU32, Contains, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier,
55+
ConstU32, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier,
5656
PrivilegeCmp,
5757
},
5858
weights::ConstantMultiplier,
@@ -142,14 +142,6 @@ pub fn native_version() -> NativeVersion {
142142
NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
143143
}
144144

145-
/// We currently allow all calls.
146-
pub struct BaseFilter;
147-
impl Contains<Call> for BaseFilter {
148-
fn contains(_c: &Call) -> bool {
149-
true
150-
}
151-
}
152-
153145
type MoreThanHalfCouncil = EitherOfDiverse<
154146
EnsureRoot<AccountId>,
155147
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>,
@@ -161,7 +153,7 @@ parameter_types! {
161153
}
162154

163155
impl frame_system::Config for Runtime {
164-
type BaseCallFilter = BaseFilter;
156+
type BaseCallFilter = frame_support::traits::Everything;
165157
type BlockWeights = BlockWeights;
166158
type BlockLength = BlockLength;
167159
type Origin = Origin;

runtime/polkadot/src/lib.rs

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId;
4040
use frame_election_provider_support::{generate_solution_type, onchain, SequentialPhragmen};
4141
use frame_support::{
4242
construct_runtime, parameter_types,
43-
traits::{
44-
Contains, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier,
45-
PrivilegeCmp,
46-
},
43+
traits::{EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, PrivilegeCmp},
4744
weights::ConstantMultiplier,
4845
PalletId, RuntimeDebug,
4946
};
@@ -135,62 +132,6 @@ pub fn native_version() -> NativeVersion {
135132
NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
136133
}
137134

138-
pub struct BaseFilter;
139-
impl Contains<Call> for BaseFilter {
140-
fn contains(call: &Call) -> bool {
141-
match call {
142-
// These modules are all allowed to be called by transactions:
143-
Call::Democracy(_) |
144-
Call::Council(_) |
145-
Call::TechnicalCommittee(_) |
146-
Call::TechnicalMembership(_) |
147-
Call::Treasury(_) |
148-
Call::PhragmenElection(_) |
149-
Call::System(_) |
150-
Call::Scheduler(_) |
151-
Call::Preimage(_) |
152-
Call::Indices(_) |
153-
Call::Babe(_) |
154-
Call::Timestamp(_) |
155-
Call::Balances(_) |
156-
Call::Authorship(_) |
157-
Call::Staking(_) |
158-
Call::Session(_) |
159-
Call::Grandpa(_) |
160-
Call::ImOnline(_) |
161-
Call::Utility(_) |
162-
Call::Claims(_) |
163-
Call::Vesting(_) |
164-
Call::Identity(_) |
165-
Call::Proxy(_) |
166-
Call::Multisig(_) |
167-
Call::Bounties(_) |
168-
Call::ChildBounties(_) |
169-
Call::Tips(_) |
170-
Call::ElectionProviderMultiPhase(_) |
171-
Call::Configuration(_) |
172-
Call::ParasShared(_) |
173-
Call::ParaInclusion(_) |
174-
Call::Paras(_) |
175-
Call::Initializer(_) |
176-
Call::ParaInherent(_) |
177-
Call::ParasDisputes(_) |
178-
Call::Dmp(_) |
179-
Call::Ump(_) |
180-
Call::Hrmp(_) |
181-
Call::Slots(_) |
182-
Call::Registrar(_) |
183-
Call::Auctions(_) |
184-
Call::Crowdloan(_) |
185-
Call::VoterList(_) |
186-
Call::XcmPallet(_) |
187-
Call::NominationPools(_) => true,
188-
// All pallets are allowed, but exhaustive match is defensive
189-
// in the case of adding new pallets.
190-
}
191-
}
192-
}
193-
194135
type MoreThanHalfCouncil = EitherOfDiverse<
195136
EnsureRoot<AccountId>,
196137
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>,
@@ -202,7 +143,7 @@ parameter_types! {
202143
}
203144

204145
impl frame_system::Config for Runtime {
205-
type BaseCallFilter = BaseFilter;
146+
type BaseCallFilter = frame_support::traits::Everything;
206147
type BlockWeights = BlockWeights;
207148
type BlockLength = BlockLength;
208149
type Origin = Origin;

runtime/westend/src/lib.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId;
2525
use frame_election_provider_support::{onchain, SequentialPhragmen};
2626
use frame_support::{
2727
construct_runtime, parameter_types,
28-
traits::{ConstU32, Contains, InstanceFilter, KeyOwnerProofSystem},
28+
traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem},
2929
weights::ConstantMultiplier,
3030
PalletId,
3131
};
@@ -129,21 +129,13 @@ pub fn native_version() -> NativeVersion {
129129
NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
130130
}
131131

132-
/// Allow everything.
133-
pub struct BaseFilter;
134-
impl Contains<Call> for BaseFilter {
135-
fn contains(_: &Call) -> bool {
136-
true
137-
}
138-
}
139-
140132
parameter_types! {
141133
pub const Version: RuntimeVersion = VERSION;
142134
pub const SS58Prefix: u8 = 42;
143135
}
144136

145137
impl frame_system::Config for Runtime {
146-
type BaseCallFilter = BaseFilter;
138+
type BaseCallFilter = frame_support::traits::Everything;
147139
type BlockWeights = BlockWeights;
148140
type BlockLength = BlockLength;
149141
type Origin = Origin;

0 commit comments

Comments
 (0)