forked from open-web3-stack/polkadot-ecosystem-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkusama.shiden.test.ts
40 lines (32 loc) · 1.24 KB
/
kusama.shiden.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { afterAll, beforeEach, describe } from 'vitest'
import { captureSnapshot, createNetworks } from '@e2e-test/networks'
import { kusama, shiden } from '@e2e-test/networks/chains'
import { query, tx } from '@e2e-test/shared/api'
import { runXcmPalletDown, runXtokensUp } from '@e2e-test/shared/xcm'
describe('kusama & shiden', async () => {
const [kusamaClient, shidenClient] = await createNetworks(kusama, shiden)
const restoreSnapshot = captureSnapshot(kusamaClient, shidenClient)
beforeEach(restoreSnapshot)
const shidenKSM = shiden.custom.ksm
const kusamaKSM = kusama.custom.ksm
afterAll(async () => {
await kusamaClient.teardown()
await shidenClient.teardown()
})
runXtokensUp('shiden transfer KSM to kusama', async () => {
return {
fromChain: shidenClient,
toChain: kusamaClient,
balance: query.assets(shidenKSM),
tx: tx.xtokens.transfer(shidenKSM, 1e12, tx.xtokens.relaychainV3),
}
})
runXcmPalletDown('kusama transfer KSM to shiden', async () => {
return {
fromChain: kusamaClient,
toChain: shidenClient,
balance: query.assets(shidenKSM),
tx: tx.xcmPallet.limitedReserveTransferAssetsV3(kusamaKSM, 1e12, tx.xcmPallet.parachainV3(0, shiden.paraId!)),
}
})
})