git.delta.rocks / unique-network / refs/commits / 6c3625540f0f

difftreelog

fix remove AllowUnpaidExecutionFrom from barrier

Daniel Shiposha2022-09-07parent: #13887cf.patch.diff
in: master

3 files changed

modifiedruntime/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,
 	),
 >;
modifiedruntime/quartz/src/xcm_barrier.rsdiffbeforeafterboth
--- 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> = {
-		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.
modifiedruntime/unique/src/xcm_barrier.rsdiffbeforeafterboth
19 traits::{Get, Everything},19 traits::{Get, Everything},
20};20};
21use sp_std::{vec, vec::Vec};21use sp_std::{vec, vec::Vec};
22use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation};22use xcm::v1::{Junction::*, Junctions::*, MultiLocation};
23use xcm_builder::{23use xcm_builder::{
24 AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowUnpaidExecutionFrom, TakeWeightCredit,24 AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
25 AllowTopLevelPaidExecutionFrom,25 AllowTopLevelPaidExecutionFrom,
26};26};
2727
31};31};
3232
33match_types! {33match_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> = {34 pub type ParentOrSiblings: impl Contains<MultiLocation> = {
39 MultiLocation { parents: 1, interior: Here } |35 MultiLocation { parents: 1, interior: Here } |
40 MultiLocation { parents: 1, interior: X1(_) }36 MultiLocation { parents: 1, interior: X1(_) }
79 (75 (
80 TakeWeightCredit,76 TakeWeightCredit,
81 AllowTopLevelPaidExecutionFrom<Everything>,77 AllowTopLevelPaidExecutionFrom<Everything>,
82 // Parent and its exec plurality get free execution
83 AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
84 // Expected responses are OK.78 // Expected responses are OK.
85 AllowKnownQueryResponses<PolkadotXcm>,79 AllowKnownQueryResponses<PolkadotXcm>,
86 // Subscriptions for version tracking are OK.80 // Subscriptions for version tracking are OK.