diff --git a/tests/acala/__snapshots__/aggregated-dex.test.ts.snap b/tests/acala/__snapshots__/aggregated-dex.test.ts.snap deleted file mode 100644 index 53854c1..0000000 --- a/tests/acala/__snapshots__/aggregated-dex.test.ts.snap +++ /dev/null @@ -1,89 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`'acala' aggregatedDex > swapWithExactSupply > events 1`] = ` -[ - { - "data": { - "liquidityChanges": [ - "(number)", - "(number)", - "(number)", - ], - "path": [ - { - "Token": "ACA", - }, - { - "Token": "AUSD", - }, - { - "Token": "LDOT", - }, - ], - "trader": "23y3WetbNi6rDMgHmyRDjgpb7PnhgPotuPPawxruTMLYTLzG", - }, - "method": "Swap", - "section": "dex", - }, -] -`; - -exports[`'karura' aggregatedDex > swapWithExactSupply > events 1`] = ` -[ - { - "data": { - "liquidityChanges": [ - "(number)", - "(number)", - "(number)", - ], - "path": [ - { - "Token": "KSM", - }, - { - "ForeignAsset": "(number)", - }, - { - "Token": "KUSD", - }, - ], - "trader": "rPizfonc8MPuEsMxufAytHjpRW7a2YrXWHKibaJXe9ZtjKx", - }, - "method": "Swap", - "section": "dex", - }, -] -`; - -exports[`'karura' aggregatedDex > swapWithExactSupply > events 2`] = ` -[ - { - "data": { - "liquidityChanges": [ - "(number)", - "(number)", - "(number)", - "(number)", - ], - "path": [ - { - "Token": "KSM", - }, - { - "Token": "KAR", - }, - { - "Token": "LKSM", - }, - { - "Token": "KUSD", - }, - ], - "trader": "rPizfonc8MPuEsMxufAytHjpRW7a2YrXWHKibaJXe9ZtjKx", - }, - "method": "Swap", - "section": "dex", - }, -] -`; diff --git a/tests/acala/aggregated-dex.test.ts b/tests/acala/aggregated-dex.test.ts index 5e6721c..8457fce 100644 --- a/tests/acala/aggregated-dex.test.ts +++ b/tests/acala/aggregated-dex.test.ts @@ -1,4 +1,4 @@ -import { afterAll, beforeAll, describe, it } from 'vitest' +import { afterAll, beforeAll, describe, expect, it } from 'vitest' import { sendTransaction } from '@acala-network/chopsticks-testing' import { Network, createContext, createNetworks } from '../../networks' @@ -31,11 +31,15 @@ describe.each([ ] as const)('$name aggregatedDex', async ({ name, swapPath }) => { let chain: Network const ctx = createContext() - const { alice } = ctx + const { alice, keyring } = ctx beforeAll(async () => { const networks = await createNetworks({ [name]: undefined }, ctx) chain = networks[name] + const meta = await chain.chain.head.meta + if (meta.registry.chainSS58) { + keyring.setSS58Format(meta.registry.chainSS58) + } // restore Homa.toBondPool to correct liquid token exchange rate const apiAt = await chain.api.at(await chain.api.rpc.chain.getBlockHash(chain.chain.head.number - 3)) @@ -58,6 +62,16 @@ describe.each([ await chain.chain.newBlock() - await checkEvents(tx, 'dex').redact({ number: true }).toMatchSnapshot() + await checkEvents(tx, 'dex').toMatchObject([ + expect.objectContaining({ + method: 'Swap', + section: 'dex', + data: expect.objectContaining({ + trader: alice.address, + path: expect.arrayContaining(swapPath[0].Dex as any), + liquidityChanges: expect.arrayContaining([1e10]), + }), + }), + ]) }) }) diff --git a/tests/bridge-sdk/__snapshots__/kusama.test.ts.snap b/tests/bridge-sdk/__snapshots__/kusama.test.ts.snap index 0bcfd10..964971f 100644 --- a/tests/bridge-sdk/__snapshots__/kusama.test.ts.snap +++ b/tests/bridge-sdk/__snapshots__/kusama.test.ts.snap @@ -149,7 +149,7 @@ exports[`'karura' to 'assetHubKusama' using bridgeSDK cross-chain 'USDT' > Cross } `; -exports[`'karura' to 'assetHubKusama' using bridgeSDK cross-chain 'USDT' > Cross-chain using BridgeSDK works > fee 1`] = `"(rounded 0.0006)"`; +exports[`'karura' to 'assetHubKusama' using bridgeSDK cross-chain 'USDT' > Cross-chain using BridgeSDK works > fee 1`] = `"(rounded 0.0005)"`; exports[`'karura' to 'assetHubKusama' using bridgeSDK cross-chain 'USDT' > Cross-chain using BridgeSDK works > initial 1`] = ` { diff --git a/vitest.config.mts b/vitest.config.mts index 6274167..abd7bee 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -3,7 +3,7 @@ import swc from 'unplugin-swc' export default defineConfig({ test: { - hookTimeout: 180_000, + hookTimeout: 240_000, testTimeout: 240_000, pool: 'forks', passWithNoTests: true,