forked from open-web3-stack/polkadot-ecosystem-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
basilisk.karura.test.ts
63 lines (56 loc) · 2.23 KB
/
basilisk.karura.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { describe } from 'vitest'
import { basilisk, karura, kusama } from '@e2e-test/networks/chains'
import { defaultAccounts } from '@e2e-test/networks'
import { query, tx } from '@e2e-test/shared/api'
import { runXtokenstHorizontal } from '@e2e-test/shared/xcm'
import { setupNetworks } from '@e2e-test/shared'
describe('basilisk & karura', async () => {
const [karuraClient, basiliskClient, kusamaClient] = await setupNetworks(karura, basilisk, kusama)
runXtokenstHorizontal('karura transfer KSM to basilisk', async () => {
return {
fromChain: karuraClient,
toChain: basiliskClient,
routeChain: kusamaClient,
isCheckUmp: true,
toAccount: defaultAccounts.bob,
fromBalance: query.tokens(karura.custom.ksm),
toBalance: query.tokens(basilisk.custom.relayToken),
tx: tx.xtokens.transfer(karura.custom.ksm, 10n ** 12n, tx.xtokens.parachainV4(basilisk.paraId!)),
}
})
runXtokenstHorizontal('basilisk transfer KSM to karura', async () => {
return {
fromChain: basiliskClient,
toChain: karuraClient,
routeChain: kusamaClient,
isCheckUmp: true,
toAccount: defaultAccounts.bob,
fromBalance: query.tokens(basilisk.custom.relayToken),
toBalance: query.tokens(karura.custom.ksm),
tx: tx.xtokens.transfer(basilisk.custom.relayToken, 10n ** 12n, tx.xtokens.parachainV4(karura.paraId!)),
}
})
runXtokenstHorizontal('basilisk transfer BSX to karura', async () => {
return {
fromChain: basiliskClient,
toChain: karuraClient,
fromBalance: query.balances,
toBalance: query.tokens(karura.custom.bsx),
tx: tx.xtokens.transfer(basilisk.custom.bsx, 10n ** 15n, tx.xtokens.parachainV4(karura.paraId!)),
}
})
runXtokenstHorizontal('karura transfer BSX to basilisk', async () => {
await karuraClient.dev.setStorage({
Tokens: {
Accounts: [[[defaultAccounts.alice.address, karura.custom.bsx], { free: 10n * 10n ** 15n }]],
},
})
return {
fromChain: karuraClient,
toChain: basiliskClient,
fromBalance: query.tokens(karura.custom.bsx),
toBalance: query.balances,
tx: tx.xtokens.transfer(karura.custom.bsx, 10n ** 15n, tx.xtokens.parachainV4(basilisk.paraId!)),
}
})
})