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

Commit b3c38f0

Browse files
authored
Companion to #9514 (Remove Filter and use Contains instead) (#566)
* Remove Filter and use Contains instead * Fixes * Remove patch * Bump Polkadot * bump
1 parent 6637471 commit b3c38f0

File tree

13 files changed

+298
-309
lines changed

13 files changed

+298
-309
lines changed

Cargo.lock

+265-276
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pallets/collator-selection/src/mock.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ parameter_types! {
5555
}
5656

5757
impl system::Config for Test {
58-
type BaseCallFilter = frame_support::traits::AllowAll;
58+
type BaseCallFilter = frame_support::traits::Everything;
5959
type BlockWeights = ();
6060
type BlockLength = ();
6161
type DbWeight = ();

pallets/dmp-queue/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ mod tests {
396396
type OnNewAccount = ();
397397
type OnKilledAccount = ();
398398
type DbWeight = ();
399-
type BaseCallFilter = frame_support::traits::AllowAll;
399+
type BaseCallFilter = frame_support::traits::Everything;
400400
type SystemWeightInfo = ();
401401
type SS58Prefix = ();
402402
type OnSetCode = ();

pallets/parachain-system/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl frame_system::Config for Test {
8888
type OnNewAccount = ();
8989
type OnKilledAccount = ();
9090
type DbWeight = ();
91-
type BaseCallFilter = frame_support::traits::AllowAll;
91+
type BaseCallFilter = frame_support::traits::Everything;
9292
type SystemWeightInfo = ();
9393
type SS58Prefix = ();
9494
type OnSetCode = ParachainSetCode<Self>;

pallets/xcmp-queue/src/mock.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ parameter_types! {
5050
type AccountId = u64;
5151

5252
impl frame_system::Config for Test {
53-
type BaseCallFilter = frame_support::traits::AllowAll;
53+
type BaseCallFilter = frame_support::traits::Everything;
5454
type BlockWeights = ();
5555
type BlockLength = ();
5656
type DbWeight = ();

polkadot-parachains/rococo/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use sp_version::RuntimeVersion;
3838
// A few exports that help ease life for downstream crates.
3939
pub use frame_support::{
4040
construct_runtime, match_type, parameter_types,
41-
traits::{All, IsInVec, Randomness},
41+
traits::{Everything, IsInVec, Randomness},
4242
weights::{
4343
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
4444
DispatchClass, IdentityFee, Weight,
@@ -179,7 +179,7 @@ impl frame_system::Config for Runtime {
179179
type OnNewAccount = ();
180180
type OnKilledAccount = ();
181181
type DbWeight = ();
182-
type BaseCallFilter = frame_support::traits::AllowAll;
182+
type BaseCallFilter = frame_support::traits::Everything;
183183
type SystemWeightInfo = ();
184184
type BlockWeights = RuntimeBlockWeights;
185185
type BlockLength = RuntimeBlockLength;
@@ -328,7 +328,7 @@ match_type! {
328328

329329
pub type Barrier = (
330330
TakeWeightCredit,
331-
AllowTopLevelPaidExecutionFrom<All<MultiLocation>>,
331+
AllowTopLevelPaidExecutionFrom<Everything>,
332332
AllowUnpaidExecutionFrom<ParentOrParentsUnitPlurality>,
333333
// ^^^ Parent & its unit plurality gets free execution
334334
);
@@ -366,9 +366,9 @@ impl pallet_xcm::Config for Runtime {
366366
type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
367367
type XcmRouter = XcmRouter;
368368
type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
369-
type XcmExecuteFilter = All<(MultiLocation, Xcm<Call>)>;
369+
type XcmExecuteFilter = Everything;
370370
type XcmExecutor = XcmExecutor<XcmConfig>;
371-
type XcmTeleportFilter = All<(MultiLocation, Vec<MultiAsset>)>;
371+
type XcmTeleportFilter = Everything;
372372
type XcmReserveTransferFilter = ();
373373
type Weigher = FixedWeightBounds<UnitWeightCost, Call>;
374374
type LocationInverter = LocationInverter<Ancestry>;

polkadot-parachains/shell/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use sp_version::RuntimeVersion;
3838
// A few exports that help ease life for downstream crates.
3939
pub use frame_support::{
4040
construct_runtime, match_type, parameter_types,
41-
traits::{All, IsInVec, Randomness},
41+
traits::{Everything, IsInVec, Randomness},
4242
weights::{
4343
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
4444
DispatchClass, IdentityFee, Weight,
@@ -145,7 +145,7 @@ impl frame_system::Config for Runtime {
145145
type OnNewAccount = ();
146146
type OnKilledAccount = ();
147147
type DbWeight = ();
148-
type BaseCallFilter = frame_support::traits::AllowAll;
148+
type BaseCallFilter = frame_support::traits::Everything;
149149
type SystemWeightInfo = ();
150150
type BlockWeights = RuntimeBlockWeights;
151151
type BlockLength = RuntimeBlockLength;

polkadot-parachains/statemine/src/lib.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use codec::{Decode, Encode, MaxEncodedLen};
4343
use constants::{currency::*, fee::WeightToFee};
4444
use frame_support::{
4545
construct_runtime, match_type, parameter_types,
46-
traits::{All, Filter, InstanceFilter},
46+
traits::{Everything, Contains, InstanceFilter},
4747
weights::{
4848
constants::{BlockExecutionWeight, ExtrinsicBaseWeight},
4949
DispatchClass, IdentityFee, Weight,
@@ -144,8 +144,8 @@ parameter_types! {
144144
}
145145

146146
pub struct BaseFilter;
147-
impl Filter<Call> for BaseFilter {
148-
fn filter(_c: &Call) -> bool { true }
147+
impl Contains<Call> for BaseFilter {
148+
fn contains(_c: &Call) -> bool { true }
149149
}
150150

151151
// Configure FRAME pallets to include in runtime.
@@ -534,7 +534,7 @@ match_type! {
534534

535535
pub type Barrier = (
536536
TakeWeightCredit,
537-
AllowTopLevelPaidExecutionFrom<All<MultiLocation>>,
537+
AllowTopLevelPaidExecutionFrom<Everything>,
538538
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
539539
// ^^^ Parent and its exec plurality get free execution
540540
);
@@ -576,10 +576,10 @@ impl pallet_xcm::Config for Runtime {
576576
type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
577577
type XcmRouter = XcmRouter;
578578
type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
579-
type XcmExecuteFilter = All<(MultiLocation, Xcm<Call>)>;
579+
type XcmExecuteFilter = Everything;
580580
type XcmExecutor = XcmExecutor<XcmConfig>;
581-
type XcmTeleportFilter = All<(MultiLocation, Vec<MultiAsset>)>;
582-
type XcmReserveTransferFilter = All<(MultiLocation, Vec<MultiAsset>)>;
581+
type XcmTeleportFilter = Everything;
582+
type XcmReserveTransferFilter = Everything;
583583
type Weigher = FixedWeightBounds<UnitWeightCost, Call>;
584584
type LocationInverter = LocationInverter<Ancestry>;
585585
}

polkadot-parachains/statemint-common/src/impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ mod tests {
9999
}
100100

101101
impl frame_system::Config for Test {
102-
type BaseCallFilter = frame_support::traits::AllowAll;
102+
type BaseCallFilter = frame_support::traits::Everything;
103103
type Origin = Origin;
104104
type Index = u64;
105105
type BlockNumber = u64;

polkadot-parachains/statemint/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use codec::{Decode, Encode, MaxEncodedLen};
4343
use constants::{currency::*, fee::WeightToFee};
4444
use frame_support::{
4545
construct_runtime, match_type, parameter_types,
46-
traits::{All, InstanceFilter},
46+
traits::{Everything, InstanceFilter},
4747
weights::{
4848
constants::{BlockExecutionWeight, ExtrinsicBaseWeight},
4949
DispatchClass, IdentityFee, Weight,
@@ -145,7 +145,7 @@ parameter_types! {
145145

146146
// Configure FRAME pallets to include in runtime.
147147
impl frame_system::Config for Runtime {
148-
type BaseCallFilter = frame_support::traits::AllowAll;
148+
type BaseCallFilter = frame_support::traits::Everything;
149149
type BlockWeights = RuntimeBlockWeights;
150150
type BlockLength = RuntimeBlockLength;
151151
type AccountId = AccountId;
@@ -502,7 +502,7 @@ match_type! {
502502

503503
pub type Barrier = (
504504
TakeWeightCredit,
505-
AllowTopLevelPaidExecutionFrom<All<MultiLocation>>,
505+
AllowTopLevelPaidExecutionFrom<Everything>,
506506
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
507507
// ^^^ Parent and its exec plurality get free execution
508508
);
@@ -544,10 +544,10 @@ impl pallet_xcm::Config for Runtime {
544544
type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
545545
type XcmRouter = XcmRouter;
546546
type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
547-
type XcmExecuteFilter = All<(MultiLocation, Xcm<Call>)>;
547+
type XcmExecuteFilter = Everything;
548548
type XcmExecutor = XcmExecutor<XcmConfig>;
549-
type XcmTeleportFilter = All<(MultiLocation, Vec<MultiAsset>)>;
550-
type XcmReserveTransferFilter = All<(MultiLocation, Vec<MultiAsset>)>;
549+
type XcmTeleportFilter = Everything;
550+
type XcmReserveTransferFilter = Everything;
551551
type Weigher = FixedWeightBounds<UnitWeightCost, Call>;
552552
type LocationInverter = LocationInverter<Ancestry>;
553553
}

polkadot-parachains/westmint/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use codec::{Decode, Encode, MaxEncodedLen};
4343
use constants::{currency::*, fee::WeightToFee};
4444
use frame_support::{
4545
construct_runtime, match_type, parameter_types,
46-
traits::{All, InstanceFilter},
46+
traits::{Everything, InstanceFilter},
4747
weights::{
4848
constants::{BlockExecutionWeight, ExtrinsicBaseWeight},
4949
DispatchClass, IdentityFee, Weight,
@@ -145,7 +145,7 @@ parameter_types! {
145145

146146
// Configure FRAME pallets to include in runtime.
147147
impl frame_system::Config for Runtime {
148-
type BaseCallFilter = frame_support::traits::AllowAll;
148+
type BaseCallFilter = frame_support::traits::Everything;
149149
type BlockWeights = RuntimeBlockWeights;
150150
type BlockLength = RuntimeBlockLength;
151151
type AccountId = AccountId;
@@ -500,7 +500,7 @@ match_type! {
500500

501501
pub type Barrier = (
502502
TakeWeightCredit,
503-
AllowTopLevelPaidExecutionFrom<All<MultiLocation>>,
503+
AllowTopLevelPaidExecutionFrom<Everything>,
504504
AllowUnpaidExecutionFrom<ParentOrParentsPlurality>,
505505
// ^^^ Parent & its plurality gets free execution
506506
);
@@ -542,10 +542,10 @@ impl pallet_xcm::Config for Runtime {
542542
type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
543543
type XcmRouter = XcmRouter;
544544
type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
545-
type XcmExecuteFilter = All<(MultiLocation, Xcm<Call>)>;
545+
type XcmExecuteFilter = Everything;
546546
type XcmExecutor = XcmExecutor<XcmConfig>;
547-
type XcmTeleportFilter = All<(MultiLocation, Vec<MultiAsset>)>;
548-
type XcmReserveTransferFilter = All<(MultiLocation, Vec<MultiAsset>)>;
547+
type XcmTeleportFilter = Everything;
548+
type XcmReserveTransferFilter = Everything;
549549
type Weigher = FixedWeightBounds<UnitWeightCost, Call>;
550550
type LocationInverter = LocationInverter<Ancestry>;
551551
}

primitives/utility/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl<T: UpwardMessageSender, W: WrapVersion> SendXcm for ParentAsUmp<T, W> {
3636
fn send_xcm(dest: MultiLocation, msg: Xcm<()>) -> Result<(), XcmError> {
3737
match &dest {
3838
// An upward message for the relay chain.
39-
MultiLocation::X1(Parent) => {
39+
X1(Parent) => {
4040
let versioned_xcm = W::wrap_version(&dest, msg)
4141
.map_err(|()| XcmError::DestinationUnsupported)?;
4242
let data = versioned_xcm.encode();

test/runtime/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl frame_system::Config for Runtime {
184184
type OnNewAccount = ();
185185
type OnKilledAccount = ();
186186
type DbWeight = ();
187-
type BaseCallFilter = frame_support::traits::AllowAll;
187+
type BaseCallFilter = frame_support::traits::Everything;
188188
type SystemWeightInfo = ();
189189
type BlockWeights = RuntimeBlockWeights;
190190
type BlockLength = RuntimeBlockLength;

0 commit comments

Comments
 (0)