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
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17use frame_support::{17use frame_support::{weights::Weight, traits::Everything};
18 {match_types, weights::Weight},
19 traits::Everything,
20};
21use xcm::{18use xcm::{latest::Xcm, v1::MultiLocation};
22 latest::Xcm,
23 v1::{BodyId, Junction::*, Junctions::*, MultiLocation},
24};
25use xcm_builder::{AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, TakeWeightCredit};19use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit};
26use xcm_executor::traits::ShouldExecute;20use xcm_executor::traits::ShouldExecute;
2721
28use crate::runtime_common::config::xcm::{DenyThenTry, DenyTransact};22use crate::runtime_common::config::xcm::{DenyThenTry, DenyTransact};
29
30match_types! {
31 pub type ParentOrParentsUnitPlurality: impl Contains<MultiLocation> = {
32 MultiLocation { parents: 1, interior: Here } |
33 MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) }
34 };
35}
3623
37/// Execution barrier that just takes `max_weight` from `weight_credit`.24/// Execution barrier that just takes `max_weight` from `weight_credit`.
38///25///
56 (43 (
57 TakeWeightCredit,44 TakeWeightCredit,
58 AllowTopLevelPaidExecutionFrom<Everything>,45 AllowTopLevelPaidExecutionFrom<Everything>,
59 AllowUnpaidExecutionFrom<ParentOrParentsUnitPlurality>,
60 // ^^^ Parent & its unit plurality gets free execution
61 AllowAllDebug,46 AllowAllDebug,
62 ),47 ),
63>;48>;
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
--- 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.