diff --git a/tests/xcm-transfer/__snapshots__/astar-asset-hub.test.ts.snap b/tests/xcm-transfer/__snapshots__/astar-asset-hub.test.ts.snap index 383b458..7c63b78 100644 --- a/tests/xcm-transfer/__snapshots__/astar-asset-hub.test.ts.snap +++ b/tests/xcm-transfer/__snapshots__/astar-asset-hub.test.ts.snap @@ -219,7 +219,7 @@ exports[`Astar & AssetHub > 002: Astar transfer USDT to AssetHub > 002: statemin "success": true, "weightUsed": { "proofSize": "(rounded 11000)", - "refTime": "(rounded 980000000)", + "refTime": "(rounded 1000000000)", }, }, "method": "Processed", @@ -238,8 +238,8 @@ exports[`Astar & AssetHub > 003: Transfer DOT from AssetHub (statemint) to Astar }, "success": true, "weightUsed": { - "proofSize": "(rounded 9400)", - "refTime": "(rounded 900000000)", + "proofSize": "(rounded 340000)", + "refTime": "(rounded 29000000000)", }, }, "method": "Processed", @@ -295,7 +295,7 @@ exports[`Astar & AssetHub > 003: Transfer DOT from AssetHub (statemint) to Astar "depositAsset": { "assets": { "wild": { - "allCounted": 1, + "all": null, }, }, "beneficiary": { diff --git a/tests/xcm-transfer/__snapshots__/kusama-shiden.test.ts.snap b/tests/xcm-transfer/__snapshots__/kusama-shiden.test.ts.snap deleted file mode 100644 index 80f8aa8..0000000 --- a/tests/xcm-transfer/__snapshots__/kusama-shiden.test.ts.snap +++ /dev/null @@ -1,202 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`Kusama & Shiden > 001: Kusama transfer KSM to Shiden > 001: kusama event 1`] = ` -[ - { - "data": { - "outcome": { - "Complete": { - "used": { - "proofSize": "(rounded 6200)", - "refTime": "(rounded 360000000)", - }, - }, - }, - }, - "method": "Attempted", - "section": "xcmPallet", - }, - { - "data": { - "fees": [ - { - "fun": { - "Fungible": "(rounded 1300000000)", - }, - "id": { - "interior": "Here", - "parents": 0, - }, - }, - ], - "paying": { - "interior": { - "X1": [ - { - "AccountId32": { - "id": "(hash)", - "network": "Kusama", - }, - }, - ], - }, - "parents": 0, - }, - }, - "method": "FeesPaid", - "section": "xcmPallet", - }, - { - "data": { - "destination": { - "interior": { - "X1": [ - { - "Parachain": "(rounded 2000)", - }, - ], - }, - "parents": 0, - }, - "message": [ - { - "ReserveAssetDeposited": [ - { - "fun": { - "Fungible": 1000000000000, - }, - "id": { - "interior": "Here", - "parents": 1, - }, - }, - ], - }, - "ClearOrigin", - { - "BuyExecution": { - "fees": { - "fun": { - "Fungible": 1000000000000, - }, - "id": { - "interior": "Here", - "parents": 1, - }, - }, - "weightLimit": "Unlimited", - }, - }, - { - "DepositAsset": { - "assets": { - "Wild": { - "AllCounted": 1, - }, - }, - "beneficiary": { - "interior": { - "X1": [ - { - "AccountId32": { - "id": "(hash)", - "network": null, - }, - }, - ], - }, - "parents": 0, - }, - }, - }, - ], - "messageId": "(hash)", - "origin": { - "interior": { - "X1": [ - { - "AccountId32": { - "id": "(hash)", - "network": "Kusama", - }, - }, - ], - }, - "parents": 0, - }, - }, - "method": "Sent", - "section": "xcmPallet", - }, -] -`; - -exports[`Kusama & Shiden > 001: Kusama transfer KSM to Shiden > 003: shiden event 1`] = ` -[ - { - "data": { - "count": 1, - }, - "method": "DownwardMessagesReceived", - "section": "parachainSystem", - }, - { - "data": { - "dmqHead": "(hash)", - "weightUsed": { - "proofSize": "(rounded 8000)", - "refTime": "(rounded 530000000)", - }, - }, - "method": "DownwardMessagesProcessed", - "section": "parachainSystem", - }, - { - "data": { - "id": "(hash)", - "origin": "Parent", - "success": true, - "weightUsed": { - "proofSize": "(rounded 9300)", - "refTime": "(rounded 900000000)", - }, - }, - "method": "Processed", - "section": "messageQueue", - }, -] -`; - -exports[`Kusama & Shiden > 002: Shiden transfer DOT to Kusama > 001: shiden event 1`] = ` -[ - { - "data": { - "messageHash": "(hash)", - }, - "method": "UpwardMessageSent", - "section": "parachainSystem", - }, -] -`; - -exports[`Kusama & Shiden > 002: Shiden transfer DOT to Kusama > 002: kusama event 1`] = ` -[ - { - "data": { - "id": "(hash)", - "origin": { - "Ump": { - "Para": "(rounded 2000)", - }, - }, - "success": true, - "weightUsed": { - "proofSize": "(rounded 7200)", - "refTime": "(rounded 360000000)", - }, - }, - "method": "Processed", - "section": "messageQueue", - }, -] -`; diff --git a/tests/xcm-transfer/__snapshots__/polkadot-astar.test.ts.snap b/tests/xcm-transfer/__snapshots__/polkadot-astar.test.ts.snap deleted file mode 100644 index 327f27b..0000000 --- a/tests/xcm-transfer/__snapshots__/polkadot-astar.test.ts.snap +++ /dev/null @@ -1,202 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`Polkadot & Astar > 001: Polkadot transfer DOT to Astar > 001: polkadot event 1`] = ` -[ - { - "data": { - "outcome": { - "Complete": { - "used": { - "proofSize": "(rounded 6200)", - "refTime": "(rounded 270000000)", - }, - }, - }, - }, - "method": "Attempted", - "section": "xcmPallet", - }, - { - "data": { - "fees": [ - { - "fun": { - "Fungible": "(rounded 400000000)", - }, - "id": { - "interior": "Here", - "parents": 0, - }, - }, - ], - "paying": { - "interior": { - "X1": [ - { - "AccountId32": { - "id": "(hash)", - "network": "Polkadot", - }, - }, - ], - }, - "parents": 0, - }, - }, - "method": "FeesPaid", - "section": "xcmPallet", - }, - { - "data": { - "destination": { - "interior": { - "X1": [ - { - "Parachain": "(rounded 2000)", - }, - ], - }, - "parents": 0, - }, - "message": [ - { - "ReserveAssetDeposited": [ - { - "fun": { - "Fungible": 1000000000000, - }, - "id": { - "interior": "Here", - "parents": 1, - }, - }, - ], - }, - "ClearOrigin", - { - "BuyExecution": { - "fees": { - "fun": { - "Fungible": 1000000000000, - }, - "id": { - "interior": "Here", - "parents": 1, - }, - }, - "weightLimit": "Unlimited", - }, - }, - { - "DepositAsset": { - "assets": { - "Wild": { - "AllCounted": 1, - }, - }, - "beneficiary": { - "interior": { - "X1": [ - { - "AccountId32": { - "id": "(hash)", - "network": null, - }, - }, - ], - }, - "parents": 0, - }, - }, - }, - ], - "messageId": "(hash)", - "origin": { - "interior": { - "X1": [ - { - "AccountId32": { - "id": "(hash)", - "network": "Polkadot", - }, - }, - ], - }, - "parents": 0, - }, - }, - "method": "Sent", - "section": "xcmPallet", - }, -] -`; - -exports[`Polkadot & Astar > 001: Polkadot transfer DOT to Astar > 002: astar event 1`] = ` -[ - { - "data": { - "count": 1, - }, - "method": "DownwardMessagesReceived", - "section": "parachainSystem", - }, - { - "data": { - "dmqHead": "(hash)", - "weightUsed": { - "proofSize": "(rounded 8000)", - "refTime": "(rounded 530000000)", - }, - }, - "method": "DownwardMessagesProcessed", - "section": "parachainSystem", - }, - { - "data": { - "id": "(hash)", - "origin": "Parent", - "success": true, - "weightUsed": { - "proofSize": "(rounded 9400)", - "refTime": "(rounded 900000000)", - }, - }, - "method": "Processed", - "section": "messageQueue", - }, -] -`; - -exports[`Polkadot & Astar > 002: Astar transfer DOT to Polkadot > 001: astar event 1`] = ` -[ - { - "data": { - "messageHash": "(hash)", - }, - "method": "UpwardMessageSent", - "section": "parachainSystem", - }, -] -`; - -exports[`Polkadot & Astar > 002: Astar transfer DOT to Polkadot > 002: polkadot event 1`] = ` -[ - { - "data": { - "id": "(hash)", - "origin": { - "Ump": { - "Para": "(rounded 2000)", - }, - }, - "success": true, - "weightUsed": { - "proofSize": "(rounded 7200)", - "refTime": "(rounded 290000000)", - }, - }, - "method": "Processed", - "section": "messageQueue", - }, -] -`; diff --git a/tests/xcm-transfer/astar-asset-hub.test.ts b/tests/xcm-transfer/astar-asset-hub.test.ts index b45e045..f8a1d53 100644 --- a/tests/xcm-transfer/astar-asset-hub.test.ts +++ b/tests/xcm-transfer/astar-asset-hub.test.ts @@ -76,7 +76,7 @@ describe('Astar & AssetHub', () => { '003: Transfer DOT from AssetHub (statemint) to Astar', async ({ networks: { astar, statemint }, keyring: { alice, bob } }) => { await tx.xcmPallet - .limitedReserveTransferAssetsV3(statemintUtil.dot, 1e12, tx.xcmPallet.parachainV3( + .transferAssetsUsingTypeAndThenV3(statemintUtil.dot, 1e12, tx.xcmPallet.parachainV3( 1, astarUtil.paraId, ))(statemint, bob.addressRaw) @@ -93,7 +93,7 @@ describe('Astar & AssetHub', () => { const bobBalance = await query.assets(astarUtil.dot)(astar, bob.address) expect(bobBalance.unwrap().balance.toNumber()).closeTo( 1_000_000_000_000, - 1_000_000, // some fee + 1e8, // some fee 'Expected amount was not received', ) diff --git a/tests/xcm-transfer/polkadot-astar.test.ts b/tests/xcm-transfer/polkadot-astar.test.ts deleted file mode 100644 index 3414907..0000000 --- a/tests/xcm-transfer/polkadot-astar.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { astar as astarUtil } from '../../networks/astar' -import { checkSystemEvents, given } from '../../helpers' -import { describe, expect } from 'vitest' -import { polkadot as polkadotUtil } from '../../networks/polkadot' -import { query, tx } from '../../helpers/api' - -describe('Polkadot & Astar', () => { - given('polkadot', 'astar')( - '001: Polkadot transfer DOT to Astar', - async ({ networks: { astar, polkadot }, keyring: { alice, bob } }) => { - await tx.xcmPallet - .limitedReserveTransferAssetsV3(polkadotUtil.dot, 1e12, tx.xcmPallet.parachainV3( - 0, - astarUtil.paraId, - ))(polkadot, bob.addressRaw) - .signAndSend(alice) - - await polkadot.chain.newBlock() - - await checkSystemEvents(polkadot, 'xcmPallet').toMatchSnapshot('001: polkadot event') - - await astar.chain.newBlock() - - const bobBalance = await query.assets(astarUtil.dot)(astar, bob.address) - expect(bobBalance.unwrap().balance.toNumber()).closeTo( - 1e12, - 1e6, // some fee - 'Expected amount was not received', - ) - - await checkSystemEvents(astar, 'parachainSystem', 'dmpQueue', 'messageQueue').toMatchSnapshot('002: astar event') - }, - ) - - given('polkadot', 'astar')( - '002: Astar transfer DOT to Polkadot', - async ({ networks: { astar, polkadot }, keyring: { alice, bob } }) => { - await tx.xtokens.transfer(astarUtil.dot, 1e12, tx.xtokens.relaychainV3)(astar, bob.addressRaw).signAndSend(alice) - - await astar.chain.newBlock() - - await checkSystemEvents(astar, 'parachainSystem', 'dmpQueue', 'messageQueue').toMatchSnapshot('001: astar event') - - await polkadot.chain.newBlock() - - const bobBalance = await polkadot.api.query.system.account(bob.address) - expect(bobBalance.data.free.toNumber()).closeTo( - 1e12, - 1e8, // some fee - 'Expected amount was not received', - ) - - await checkSystemEvents(polkadot, 'messageQueue').toMatchSnapshot('002: polkadot event') - }, - ) -})