diff --git a/tests/acala/__snapshots__/liquid-crowdloan.test.ts.snap b/tests/acala/__snapshots__/liquid-crowdloan.test.ts.snap deleted file mode 100644 index 6d8e88c..0000000 --- a/tests/acala/__snapshots__/liquid-crowdloan.test.ts.snap +++ /dev/null @@ -1,298 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`liquid crowdloan > works > after all transfer relaychain events 1`] = ` -[ - { - "data": { - "id": "(hash)", - "origin": { - "Ump": { - "Para": 2000, - }, - }, - "success": false, - "weightUsed": { - "proofSize": 0, - "refTime": 1000000000, - }, - }, - "method": "Processed", - "section": "messageQueue", - }, - { - "data": [ - { - "Complete": { - "proofSize": 0, - "refTime": 2000000000, - }, - }, - ], - "method": "Attempted", - "section": "xcmPallet", - }, - { - "data": { - "result": "Ok", - }, - "method": "ProxyExecuted", - "section": "proxy", - }, - { - "data": { - "id": "(hash)", - "origin": { - "Ump": { - "Para": 2000, - }, - }, - "success": true, - "weightUsed": { - "proofSize": "(rounded 66000)", - "refTime": 55000000000, - }, - }, - "method": "Processed", - "section": "messageQueue", - }, -] -`; - -exports[`liquid crowdloan > works > after all transfer ump 1`] = ` -[ - { - "v2": [ - { - "withdrawAsset": [ - { - "fun": { - "fungible": 20000000000, - }, - "id": { - "concrete": { - "interior": { - "here": null, - }, - "parents": 0, - }, - }, - }, - ], - }, - { - "buyExecution": { - "fees": { - "fun": { - "fungible": 20000000000, - }, - "id": { - "concrete": { - "interior": { - "here": null, - }, - "parents": 0, - }, - }, - }, - "weightLimit": { - "unlimited": null, - }, - }, - }, - { - "transact": { - "call": { - "encoded": "0x1d000059fe89295c2e57d7b4d4d8be9e00a3802e513703ab4b5b424ed0a646e899d3c900630803000100411f03000101006d6f646c6163612f6c71636c000000000000000000000000000000000000000003040000000013e7db26b01ac758030000000000", - }, - "originType": "SovereignAccount", - "requireWeightAtMost": 50000000000, - }, - }, - { - "refundSurplus": null, - }, - { - "depositAsset": { - "assets": { - "wild": { - "all": null, - }, - }, - "beneficiary": { - "interior": { - "x1": { - "parachain": 2000, - }, - }, - "parents": 0, - }, - "maxAssets": 1, - }, - }, - ], - }, -] -`; - -exports[`liquid crowdloan > works > first redeem 1`] = ` -[ - { - "data": { - "amount": 90000000000, - "currencyId": { - "Token": "DOT", - }, - }, - "method": "Redeemed", - "section": "liquidCrowdloan", - }, -] -`; - -exports[`liquid crowdloan > works > pallet account balance 1`] = ` -{ - "free": "(rounded 100000000000)", - "frozen": 0, - "reserved": 0, -} -`; - -exports[`liquid crowdloan > works > pallet account balance after all transfer 1`] = ` -{ - "free": "(rounded 240000000000000000)", - "frozen": 0, - "reserved": 0, -} -`; - -exports[`liquid crowdloan > works > second redeem 1`] = ` -[ - { - "data": { - "amount": 4000000000000, - "currencyId": { - "Token": "DOT", - }, - }, - "method": "Redeemed", - "section": "liquidCrowdloan", - }, -] -`; - -exports[`liquid crowdloan > works > system events 1`] = ` -[ - { - "data": [ - { - "Complete": { - "proofSize": 0, - "refTime": 2000000000, - }, - }, - ], - "method": "Attempted", - "section": "xcmPallet", - }, - { - "data": { - "result": "Ok", - }, - "method": "ProxyExecuted", - "section": "proxy", - }, - { - "data": { - "id": "(hash)", - "origin": { - "Ump": { - "Para": 2000, - }, - }, - "success": true, - "weightUsed": { - "proofSize": "(rounded 66000)", - "refTime": 55000000000, - }, - }, - "method": "Processed", - "section": "messageQueue", - }, -] -`; - -exports[`liquid crowdloan > works > ump 1`] = ` -[ - { - "v2": [ - { - "withdrawAsset": [ - { - "fun": { - "fungible": 20000000000, - }, - "id": { - "concrete": { - "interior": { - "here": null, - }, - "parents": 0, - }, - }, - }, - ], - }, - { - "buyExecution": { - "fees": { - "fun": { - "fungible": 20000000000, - }, - "id": { - "concrete": { - "interior": { - "here": null, - }, - "parents": 0, - }, - }, - }, - "weightLimit": { - "unlimited": null, - }, - }, - }, - { - "transact": { - "call": { - "encoded": "0x1d000059fe89295c2e57d7b4d4d8be9e00a3802e513703ab4b5b424ed0a646e899d3c900630803000100411f03000101006d6f646c6163612f6c71636c00000000000000000000000000000000000000000304000000000700e87648170000000000", - }, - "originType": "SovereignAccount", - "requireWeightAtMost": 50000000000, - }, - }, - { - "refundSurplus": null, - }, - { - "depositAsset": { - "assets": { - "wild": { - "all": null, - }, - }, - "beneficiary": { - "interior": { - "x1": { - "parachain": 2000, - }, - }, - "parents": 0, - }, - "maxAssets": 1, - }, - }, - ], - }, -] -`; diff --git a/tests/acala/liquid-crowdloan.test.ts b/tests/acala/liquid-crowdloan.test.ts deleted file mode 100644 index 96cc3e9..0000000 --- a/tests/acala/liquid-crowdloan.test.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { beforeEach, describe, it } from 'vitest' -import { check, checkSystemEvents, checkUmp, sendTransaction } from '@acala-network/chopsticks-testing' - -import { Network, createContext, createNetworks } from '../../networks' -import { checkEvents } from '../../helpers' - -import { acala } from '../../networks/acala' - -describe('liquid crowdloan', async () => { - let chain: Network - let relaychain: Network - const crowdloanVault = '132zsjMwGjNaUXF5XjUCDs2cDEq9Qao51TsL9RSUTGZbinVK' - const palletAccount = '23M5ttkmR6KcoCwfEJnoAgczRQdDq85ZedwGc3uzyPwiCoq8' - - const ctx = createContext() - const { alice } = ctx - - beforeEach(async () => { - const { acala: para, polkadot } = await createNetworks({ acala: undefined, polkadot: undefined }, ctx) - chain = para - relaychain = polkadot - - await chain.dev.setStorage({ - Tokens: { - Accounts: [[[alice.address, acala.lcdot], { free: 1000 * 1e10 }]], - }, - }) - - await relaychain.dev.newBlock({ - unsafeBlockHeight: 17_855_999, - count: 2, - } as any) - - return async () => chain.teardown() - }) - - it('works', async () => { - await sendTransaction(relaychain.api.tx.crowdloan.withdraw(crowdloanVault, 3336).signAsync(alice)) - await relaychain.dev.newBlock() - - await sendTransaction( - chain.api.tx.sudo.sudo(chain.api.tx.liquidCrowdloan.transferFromCrowdloanVault(10e10)).signAsync(alice), - ) - await chain.dev.newBlock() - - await checkUmp(chain).toMatchSnapshot() - - await relaychain.dev.newBlock() - - await checkSystemEvents(relaychain, 'messageQueue', 'xcmPallet', 'proxy').toMatchSnapshot() - - await chain.dev.newBlock() - - await check(chain.api.query.tokens.accounts(palletAccount, acala.dot)) - .redact() - .toMatchSnapshot('pallet account balance') - - const tx0 = await sendTransaction(chain.api.tx.liquidCrowdloan.redeem(9e10).signAsync(alice)) - - await chain.dev.newBlock() - - await checkEvents(tx0, 'liquidCrowdloan').toMatchSnapshot('first redeem') - - await sendTransaction( - chain.api.tx.sudo - .sudo(chain.api.tx.liquidCrowdloan.transferFromCrowdloanVault(241161497502735335n)) - .signAsync(alice), - ) - - await chain.dev.newBlock() - - await checkUmp(chain).toMatchSnapshot('after all transfer ump') - - await relaychain.dev.newBlock() - - await checkSystemEvents(relaychain, 'messageQueue', 'xcmPallet', 'proxy').toMatchSnapshot( - 'after all transfer relaychain events', - ) - - await chain.dev.newBlock() - - await check(chain.api.query.tokens.accounts(palletAccount, acala.dot)) - .redact() - .toMatchSnapshot('pallet account balance after all transfer') - - const tx1 = await sendTransaction(chain.api.tx.liquidCrowdloan.redeem(400e10).signAsync(alice)) - - await chain.dev.newBlock() - - await checkEvents(tx1, 'liquidCrowdloan').toMatchSnapshot('second redeem') - }) -})