forked from open-web3-stack/polkadot-ecosystem-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacala.polkadot.test.ts
46 lines (40 loc) · 1.41 KB
/
acala.polkadot.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
import { describe } from 'vitest'
import { acala, polkadot } from '@e2e-test/networks/chains'
import { query, tx } from '@e2e-test/shared/api'
import { runXcmPalletDown, runXtokensUp } from '@e2e-test/shared/xcm'
import { setupNetworks } from '@e2e-test/shared'
describe('acala & polkadot', async () => {
const [polkadotClient, acalaClient] = await setupNetworks(polkadot, acala)
const acalaDOT = acalaClient.config.custom.dot
const polkadotDOT = polkadotClient.config.custom.dot
runXtokensUp('acala transfer DOT to polkadot', async () => {
return {
fromChain: acalaClient,
toChain: polkadotClient,
balance: query.tokens(acalaDOT),
tx: tx.xtokens.transfer(acalaDOT, 1e12, tx.xtokens.relaychainV3),
}
})
runXtokensUp('acala transfer DOT wiht limited weight', async () => {
return {
fromChain: acalaClient,
toChain: polkadotClient,
balance: query.tokens(acalaDOT),
tx: tx.xtokens.transfer(acalaDOT, 1e12, tx.xtokens.relaychainV3, {
Limited: { refTime: 5000000000, proofSize: 10000 },
}),
}
})
runXcmPalletDown('polkadot transfer DOT to acala', async () => {
return {
fromChain: polkadotClient,
toChain: acalaClient,
balance: query.tokens(acalaDOT),
tx: tx.xcmPallet.limitedReserveTransferAssetsV3(
polkadotDOT,
1e12,
tx.xcmPallet.parachainV3(0, acalaClient.config.paraId!),
),
}
})
})