From fe7817e7cd8e76c83fa370825678284337b969f5 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 4 Jan 2023 13:59:52 +0100 Subject: [PATCH] refactor TrustedBridgedNetworks --- .../assets/westmint/src/xcm_config.rs | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/parachains/runtimes/assets/westmint/src/xcm_config.rs b/parachains/runtimes/assets/westmint/src/xcm_config.rs index f117230db1..352d2a31ac 100644 --- a/parachains/runtimes/assets/westmint/src/xcm_config.rs +++ b/parachains/runtimes/assets/westmint/src/xcm_config.rs @@ -153,12 +153,6 @@ match_types! { MultiLocation { parents: 1, interior: Here } | MultiLocation { parents: 1, interior: X1(Plurality { .. }) } }; - - // TODO:check-parameter - add new pallet and persist/manage this via governance? - // Means, that we accept some `GlobalConsensus` from some `MultiLocation` (which is supposed to be our bridge-hub) - pub type TrustedBridgedNetworks: impl Contains<(MultiLocation, Junction)> = { - (MultiLocation { parents: 1, interior: X1(Parachain(1014)) }, GlobalConsensus(NetworkId::Rococo)) - }; } pub type Barrier = DenyThenTry< @@ -312,6 +306,20 @@ impl EnsureOriginWithArg for ForeignCreators { } } +parameter_types! { + // TODO:check-parameter - add new pallet and persist/manage this via governance? + // Means, that we accept some `GlobalConsensus` from some `MultiLocation` (which is supposed to be our bridge-hub) + pub TrustedBridgedNetworks: sp_std::vec::Vec<(MultiLocation, Junction)> = sp_std::vec![ + (MultiLocation { parents: 1, interior: X1(Parachain(1014)) }, GlobalConsensus(NetworkId::Rococo)) + ]; +} + +impl Contains<(MultiLocation, Junction)> for TrustedBridgedNetworks { + fn contains(t: &(MultiLocation, Junction)) -> bool { + Self::get().contains(t) + } +} + pub type BridgedCallsBarrier = ( // TODO:check-parameter - verify, if we need for production (usefull at least for testing connection in production) AllowExecutionForTrapFrom,