difftreelog
fix remove AllowUnpaidExecutionFrom from barrier
in: master
3 files changed
runtime/opal/src/xcm_barrier.rsdiffbeforeafterboth--- a/runtime/opal/src/xcm_barrier.rs
+++ b/runtime/opal/src/xcm_barrier.rs
@@ -14,25 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-use frame_support::{
- {match_types, weights::Weight},
- traits::Everything,
-};
-use xcm::{
- latest::Xcm,
- v1::{BodyId, Junction::*, Junctions::*, MultiLocation},
-};
-use xcm_builder::{AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, TakeWeightCredit};
+use frame_support::{weights::Weight, traits::Everything};
+use xcm::{latest::Xcm, v1::MultiLocation};
+use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit};
use xcm_executor::traits::ShouldExecute;
use crate::runtime_common::config::xcm::{DenyThenTry, DenyTransact};
-
-match_types! {
- pub type ParentOrParentsUnitPlurality: impl Contains<MultiLocation> = {
- MultiLocation { parents: 1, interior: Here } |
- MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) }
- };
-}
/// Execution barrier that just takes `max_weight` from `weight_credit`.
///
@@ -56,8 +43,6 @@
(
TakeWeightCredit,
AllowTopLevelPaidExecutionFrom<Everything>,
- AllowUnpaidExecutionFrom<ParentOrParentsUnitPlurality>,
- // ^^^ Parent & its unit plurality gets free execution
AllowAllDebug,
),
>;
runtime/quartz/src/xcm_barrier.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use frame_support::{18 match_types, parameter_types,19 traits::{Get, Everything},20};21use sp_std::{vec, vec::Vec};22use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation};23use xcm_builder::{24 AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowUnpaidExecutionFrom, TakeWeightCredit,25 AllowTopLevelPaidExecutionFrom,26};2728use crate::{29 ParachainInfo, PolkadotXcm,30 runtime_common::config::xcm::{DenyThenTry, DenyTransact, DenyExchangeWithUnknownLocation},31};3233match_types! {34 pub type ParentOrParentsExecutivePlurality: impl Contains<MultiLocation> = {35 MultiLocation { parents: 1, interior: Here } |36 MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }37 };38 pub type ParentOrSiblings: impl Contains<MultiLocation> = {39 MultiLocation { parents: 1, interior: Here } |40 MultiLocation { parents: 1, interior: X1(_) }41 };42}4344parameter_types! {45 pub QuartzAllowedLocations: Vec<MultiLocation> = vec![46 // Self location47 MultiLocation {48 parents: 0,49 interior: Here,50 },51 // Parent location52 MultiLocation {53 parents: 1,54 interior: Here,55 },56 // Karura/Acala location57 MultiLocation {58 parents: 1,59 interior: X1(Parachain(2000)),60 },61 // Moonriver location62 MultiLocation {63 parents: 1,64 interior: X1(Parachain(2023)),65 },66 // Self parachain address67 MultiLocation {68 parents: 1,69 interior: X1(Parachain(ParachainInfo::get().into())),70 },71 ];72}7374pub type Barrier = DenyThenTry<75 (76 DenyTransact,77 DenyExchangeWithUnknownLocation<QuartzAllowedLocations>,78 ),79 (80 TakeWeightCredit,81 AllowTopLevelPaidExecutionFrom<Everything>,82 // Parent and its exec plurality get free execution83 AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,84 // Expected responses are OK.85 AllowKnownQueryResponses<PolkadotXcm>,86 // Subscriptions for version tracking are OK.87 AllowSubscriptionsFrom<ParentOrSiblings>,88 ),89>;1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use frame_support::{18 match_types, parameter_types,19 traits::{Get, Everything},20};21use sp_std::{vec, vec::Vec};22use xcm::v1::{Junction::*, Junctions::*, MultiLocation};23use xcm_builder::{24 AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,25 AllowTopLevelPaidExecutionFrom,26};2728use crate::{29 ParachainInfo, PolkadotXcm,30 runtime_common::config::xcm::{DenyThenTry, DenyTransact, DenyExchangeWithUnknownLocation},31};3233match_types! {34 pub type ParentOrSiblings: impl Contains<MultiLocation> = {35 MultiLocation { parents: 1, interior: Here } |36 MultiLocation { parents: 1, interior: X1(_) }37 };38}3940parameter_types! {41 pub QuartzAllowedLocations: Vec<MultiLocation> = vec![42 // Self location43 MultiLocation {44 parents: 0,45 interior: Here,46 },47 // Parent location48 MultiLocation {49 parents: 1,50 interior: Here,51 },52 // Karura/Acala location53 MultiLocation {54 parents: 1,55 interior: X1(Parachain(2000)),56 },57 // Moonriver location58 MultiLocation {59 parents: 1,60 interior: X1(Parachain(2023)),61 },62 // Self parachain address63 MultiLocation {64 parents: 1,65 interior: X1(Parachain(ParachainInfo::get().into())),66 },67 ];68}6970pub type Barrier = DenyThenTry<71 (72 DenyTransact,73 DenyExchangeWithUnknownLocation<QuartzAllowedLocations>,74 ),75 (76 TakeWeightCredit,77 AllowTopLevelPaidExecutionFrom<Everything>,78 // Expected responses are OK.79 AllowKnownQueryResponses<PolkadotXcm>,80 // Subscriptions for version tracking are OK.81 AllowSubscriptionsFrom<ParentOrSiblings>,82 ),83>;runtime/unique/src/xcm_barrier.rsdiffbeforeafterboth--- a/runtime/unique/src/xcm_barrier.rs
+++ b/runtime/unique/src/xcm_barrier.rs
@@ -19,9 +19,9 @@
traits::{Get, Everything},
};
use sp_std::{vec, vec::Vec};
-use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation};
+use xcm::v1::{Junction::*, Junctions::*, MultiLocation};
use xcm_builder::{
- AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowUnpaidExecutionFrom, TakeWeightCredit,
+ AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
AllowTopLevelPaidExecutionFrom,
};
@@ -31,10 +31,6 @@
};
match_types! {
- pub type ParentOrParentsExecutivePlurality: impl Contains<MultiLocation> = {
- MultiLocation { parents: 1, interior: Here } |
- MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }
- };
pub type ParentOrSiblings: impl Contains<MultiLocation> = {
MultiLocation { parents: 1, interior: Here } |
MultiLocation { parents: 1, interior: X1(_) }
@@ -79,8 +75,6 @@
(
TakeWeightCredit,
AllowTopLevelPaidExecutionFrom<Everything>,
- // Parent and its exec plurality get free execution
- AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
// Expected responses are OK.
AllowKnownQueryResponses<PolkadotXcm>,
// Subscriptions for version tracking are OK.