git.delta.rocks / unique-network / refs/commits / 58b781a796e9

difftreelog

feat allow explicit unpaid execution from parent

Daniel Shiposha2023-09-28parent: #8d26c73.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,7 +14,18 @@
 // 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::traits::Everything;
-use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit};
+use frame_support::{match_types, traits::Everything};
+use xcm::latest::{Junctions::*, MultiLocation};
+use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit, AllowExplicitUnpaidExecutionFrom};
 
-pub type Barrier = (TakeWeightCredit, AllowTopLevelPaidExecutionFrom<Everything>);
+match_types! {
+	pub type ParentOnly: impl Contains<MultiLocation> = {
+		MultiLocation { parents: 1, interior: Here }
+	};
+}
+
+pub type Barrier = (
+	TakeWeightCredit,
+	AllowExplicitUnpaidExecutionFrom<ParentOnly>,
+	AllowTopLevelPaidExecutionFrom<Everything>,
+);
modifiedruntime/quartz/src/xcm_barrier.rsdiffbeforeafterboth
18use xcm::latest::{Junctions::*, MultiLocation};18use xcm::latest::{Junctions::*, MultiLocation};
19use xcm_builder::{19use xcm_builder::{
20 AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,20 AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
21 AllowTopLevelPaidExecutionFrom,21 AllowTopLevelPaidExecutionFrom, AllowExplicitUnpaidExecutionFrom,
22};22};
2323
24use crate::PolkadotXcm;24use crate::PolkadotXcm;
2525
26match_types! {26match_types! {
27 pub type ParentOnly: impl Contains<MultiLocation> = {
28 MultiLocation { parents: 1, interior: Here }
29 };
30
27 pub type ParentOrSiblings: impl Contains<MultiLocation> = {31 pub type ParentOrSiblings: impl Contains<MultiLocation> = {
28 MultiLocation { parents: 1, interior: Here } |32 MultiLocation { parents: 1, interior: Here } |
3236
33pub type Barrier = (37pub type Barrier = (
34 TakeWeightCredit,38 TakeWeightCredit,
39 AllowExplicitUnpaidExecutionFrom<ParentOnly>,
35 AllowTopLevelPaidExecutionFrom<Everything>,40 AllowTopLevelPaidExecutionFrom<Everything>,
36 // Expected responses are OK.41 // Expected responses are OK.
37 AllowKnownQueryResponses<PolkadotXcm>,42 AllowKnownQueryResponses<PolkadotXcm>,
modifiedruntime/unique/src/xcm_barrier.rsdiffbeforeafterboth
--- a/runtime/unique/src/xcm_barrier.rs
+++ b/runtime/unique/src/xcm_barrier.rs
@@ -18,12 +18,16 @@
 use xcm::latest::{Junctions::*, MultiLocation};
 use xcm_builder::{
 	AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
-	AllowTopLevelPaidExecutionFrom,
+	AllowTopLevelPaidExecutionFrom, AllowExplicitUnpaidExecutionFrom,
 };
 
 use crate::PolkadotXcm;
 
 match_types! {
+	pub type ParentOnly: impl Contains<MultiLocation> = {
+		MultiLocation { parents: 1, interior: Here }
+	};
+
 	pub type ParentOrSiblings: impl Contains<MultiLocation> = {
 		MultiLocation { parents: 1, interior: Here } |
 		MultiLocation { parents: 1, interior: X1(_) }
@@ -32,6 +36,7 @@
 
 pub type Barrier = (
 	TakeWeightCredit,
+	AllowExplicitUnpaidExecutionFrom<ParentOnly>,
 	AllowTopLevelPaidExecutionFrom<Everything>,
 	// Expected responses are OK.
 	AllowKnownQueryResponses<PolkadotXcm>,