From 12c8c8f2523de759cf66f4368b416663ad6f88ef Mon Sep 17 00:00:00 2001 From: str-mv <51784859+str-mv@users.noreply.github.com> Date: Mon, 11 Jul 2022 09:29:18 +0000 Subject: [PATCH] Merge pull request #429 from UniqueNetwork/fix/CORE-425 [CORE-425] Restrict XCM barrier from trusting parent chain --- --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -707,7 +707,6 @@ pub type Barrier = ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, // ^^^ Parent & its unit plurality gets free execution ); --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -706,7 +706,6 @@ pub type Barrier = ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, // ^^^ Parent & its unit plurality gets free execution ); --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -705,7 +705,6 @@ pub type Barrier = ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, // ^^^ Parent & its unit plurality gets free execution ); --- a/tests/src/xcmTransfer.test.ts +++ b/tests/src/xcmTransfer.test.ts @@ -31,6 +31,7 @@ const UNIQUE_CHAIN = 1000; const KARURA_CHAIN = 2000; const KARURA_PORT = '9946'; +const TRANSFER_AMOUNT = 2000000000000000000000000n; describe('Integration test: Exchanging QTZ with Karura', () => { let alice: IKeyringPair; @@ -113,7 +114,7 @@ }, }, fun: { - Fungible: 5000000000, + Fungible: TRANSFER_AMOUNT, }, }, ], @@ -148,19 +149,17 @@ await usingApi(async (api) => { const destination = { - V0: { - X3: [ - 'Parent', - { - Parachain: UNIQUE_CHAIN, - }, - { - AccountId32: { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: UNIQUE_CHAIN}, + {AccountId32: { network: 'Any', id: alice.addressRaw, - }, - }, - ], + }}, + ], + }, }, }; @@ -168,7 +167,7 @@ ForeignAsset: 0, }; - const amount = 5000000000; + const amount = TRANSFER_AMOUNT; const destWeight = 50000000; const tx = api.tx.xTokens.transfer(id, amount, destination, destWeight); -- gitstuff