frequency_runtime/xcm/
barrier.rs1use frame_support::traits::{ConstU32, Contains, Everything};
2
3use staging_xcm::latest::prelude::*;
4use staging_xcm_builder::{
5 AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, AllowSubscriptionsFrom,
6 AllowTopLevelPaidExecutionFrom, DenyRecursively, DenyReserveTransferToRelayChain, DenyThenTry,
7 TakeWeightCredit, TrailingSetTopicAsId, WithComputedOrigin,
8};
9
10use crate::{xcm::parameters::UniversalLocation, PolkadotXcm};
11use parachains_common::xcm_config::ParentRelayOrSiblingParachains;
12
13pub struct ParentOrParentsExecutivePlurality;
14impl Contains<Location> for ParentOrParentsExecutivePlurality {
15 fn contains(location: &Location) -> bool {
16 matches!(location.unpack(), (1, []) | (1, [Plurality { id: BodyId::Executive, .. }]))
17 }
18}
19
20pub type Barrier = TrailingSetTopicAsId<
21 DenyThenTry<
22 DenyRecursively<DenyReserveTransferToRelayChain>,
23 (
24 TakeWeightCredit,
26 AllowKnownQueryResponses<PolkadotXcm>,
28 WithComputedOrigin<
29 (
30 AllowTopLevelPaidExecutionFrom<Everything>,
33 AllowExplicitUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
35 AllowSubscriptionsFrom<ParentRelayOrSiblingParachains>,
37 ),
38 UniversalLocation,
39 ConstU32<8>,
40 >,
41 ),
42 >,
43>;