From 007062b388a4b6c6331b39b06d6057e12d0bf3c2 Mon Sep 17 00:00:00 2001 From: Sergej Date: Tue, 7 May 2024 17:47:50 +0200 Subject: [PATCH] fixes | working now --- e2e_tests/fee-payment/custom.ts | 36 +------------------------ e2e_tests/xc-transfer/asset-transfer.ts | 16 +++++------ zombienet_tests/0006-xc-transfer.toml | 4 ++- 3 files changed, 11 insertions(+), 45 deletions(-) diff --git a/e2e_tests/fee-payment/custom.ts b/e2e_tests/fee-payment/custom.ts index 78c59e13..3883fdd2 100644 --- a/e2e_tests/fee-payment/custom.ts +++ b/e2e_tests/fee-payment/custom.ts @@ -26,45 +26,11 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) { const setXcmVersion = rococoApi.tx.xcmPallet.forceDefaultXcmVersion([3]); await submitExtrinsic(alice, rococoApi.tx.sudo.sudo(setXcmVersion), {}); - await setupRelayAsset(regionXApi, alice); + await setupRelayAsset(regionXApi, alice, 10n**12n); const receiverKeypair = new Keyring(); receiverKeypair.addFromAddress(alice.address); - const feeAssetItem = 0; - const weightLimit = "Unlimited"; - const reserveTransfer = rococoApi.tx.xcmPallet.limitedReserveTransferAssets( - { V3: { parents: 0, interior: { X1: { Parachain: 2000 } } } }, //dest - { - V3: { - parents: 0, - interior: { - X1: { - AccountId32: { - chain: "Any", - id: receiverKeypair.pairs[0].publicKey, - }, - }, - }, - }, - }, //beneficiary - { - V3: [ - { - id: { - Concrete: { parents: 0, interior: "Here" }, - }, - fun: { - Fungible: 10n ** 9n, - }, - }, - ], - }, //asset - feeAssetItem, - weightLimit - ); - await submitExtrinsic(alice, reserveTransfer, {}); - // Try to pay for fees with relay chain asset. const remarkCall = regionXApi.tx.system.remark("0x44"); await submitExtrinsic(alice, remarkCall, { assetId: RELAY_ASSET_ID }); diff --git a/e2e_tests/xc-transfer/asset-transfer.ts b/e2e_tests/xc-transfer/asset-transfer.ts index 95729920..a8dee966 100644 --- a/e2e_tests/xc-transfer/asset-transfer.ts +++ b/e2e_tests/xc-transfer/asset-transfer.ts @@ -17,9 +17,7 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) { const setXcmVersion = rococoApi.tx.xcmPallet.forceDefaultXcmVersion([3]); await submitExtrinsic(alice, rococoApi.tx.sudo.sudo(setXcmVersion), {}); - const BALANCE = 10n ** 9n; - - await setupRelayAsset(regionXApi, alice, BALANCE); + await setupRelayAsset(regionXApi, alice); const receiverKeypair = new Keyring(); receiverKeypair.addFromAddress(alice.address); @@ -27,7 +25,7 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) { const showBalanceOnRegionX = async () => { const { free } = ( await regionXApi.query.tokens.accounts(alice.address, RELAY_ASSET_ID) - ).toJSON() as any; + ).toHuman() as any; console.log(`RegionX: ${free}`); }; @@ -67,7 +65,7 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) { Concrete: { parents: 0, interior: "Here" }, }, fun: { - Fungible: BALANCE, + Fungible: 3n * 10n ** 12n, }, }, ], @@ -77,7 +75,7 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) { ); await submitExtrinsic(alice, rococoReserveTransfer, {}); - await sleep(15 * 1000); + await sleep(5 * 1000); await showBalanceOnRegionX(); await showBalanceOnRococo(); @@ -86,7 +84,7 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) { { V3: { parents: 1, interior: "Here" } }, //dest { V3: { - parents: 1, + parents: 0, interior: { X1: { AccountId32: { @@ -104,7 +102,7 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) { Concrete: { parents: 1, interior: "Here" }, }, fun: { - Fungible: BALANCE, + Fungible: 10n ** 12n, }, }, ], @@ -115,7 +113,7 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) { await submitExtrinsic(alice, regionXReserveTransfer, {}); - await sleep(30 * 1000); + await sleep(5 * 1000); await showBalanceOnRegionX(); await showBalanceOnRococo(); diff --git a/zombienet_tests/0006-xc-transfer.toml b/zombienet_tests/0006-xc-transfer.toml index 635f5419..d53556a4 100644 --- a/zombienet_tests/0006-xc-transfer.toml +++ b/zombienet_tests/0006-xc-transfer.toml @@ -7,10 +7,12 @@ command = "polkadot" [[relaychain.nodes]] name = "rococo-validator01" + args = [ "--log=xcm=trace" ] validator = true [[relaychain.nodes]] name = "rococo-validator02" + args = [ "--log=xcm=trace" ] validator = true [[parachains]] @@ -20,4 +22,4 @@ addToGenesis = false [parachains.collator] name = "regionx-collator01" command = "regionx-node" - args = [ "-lruntime=debug,parachain=trace" ] + args = [ "--log=xcm=trace" ]