From 6c3625540f0f3f57820342421df8d9e05e823eba Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 07 Sep 2022 12:01:06 +0000 Subject: [PATCH] fix: remove AllowUnpaidExecutionFrom from barrier --- --- 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 . -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 { 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, - AllowUnpaidExecutionFrom, - // ^^^ Parent & its unit plurality gets free execution AllowAllDebug, ), >; --- a/runtime/quartz/src/xcm_barrier.rs +++ b/runtime/quartz/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 { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } - }; pub type ParentOrSiblings: impl Contains = { MultiLocation { parents: 1, interior: Here } | MultiLocation { parents: 1, interior: X1(_) } @@ -79,8 +75,6 @@ ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, - // Parent and its exec plurality get free execution - AllowUnpaidExecutionFrom, // Expected responses are OK. AllowKnownQueryResponses, // Subscriptions for version tracking are OK. --- 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 { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } - }; pub type ParentOrSiblings: impl Contains = { MultiLocation { parents: 1, interior: Here } | MultiLocation { parents: 1, interior: X1(_) } @@ -79,8 +75,6 @@ ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, - // Parent and its exec plurality get free execution - AllowUnpaidExecutionFrom, // Expected responses are OK. AllowKnownQueryResponses, // Subscriptions for version tracking are OK. -- gitstuff