Skip to content

Commit 36d1e1c

Browse files
committed
test: AHM e2e tests
1 parent df854e9 commit 36d1e1c

22 files changed

Lines changed: 12800 additions & 1 deletion
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Cache NPM'
2+
description: 'Caching npm dependencies'
3+
inputs:
4+
cache-key:
5+
description: 'Key to use when caching npm dependencies'
6+
required: true
7+
default: 'npm-default'
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Cache NPM dependencies
12+
uses: actions/cache@v3
13+
with:
14+
path: |
15+
~/.npm
16+
node_modules
17+
key: ${{ runner.os }}-npm-${{ inputs.cache-key }}-${{ hashFiles('**/package-lock.json') }}
18+
restore-keys: |
19+
${{ runner.os }}-npm-${{ inputs.cache-key }}-
20+
${{ runner.os }}-npm-

.github/workflows/e2e.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: E2E Tests
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout sources
10+
uses: actions/checkout@v4
11+
12+
- name: Build Interlay runtime
13+
id: srtool_build
14+
uses: paritytech/srtool-actions@v0.9.3
15+
with:
16+
package: interlay-runtime-parachain
17+
runtime_dir: parachain/runtime/interlay
18+
chain: interlay
19+
- name: Save Interlay runtime
20+
uses: actions/upload-artifact@v4
21+
with:
22+
name: interlay-runtime
23+
path: |
24+
${{ steps.srtool_build.outputs.wasm_compressed }}
25+
26+
lint:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v3
30+
- uses: ./.github/actions/cache-npm
31+
with:
32+
cache-key: npm
33+
34+
- name: Use Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: 'lts/*'
38+
39+
- name: Install npm-dependencies
40+
run: |
41+
npm install
42+
working-directory: ./e2e_tests
43+
44+
- name: Run lint
45+
run: |
46+
npm run fmt-check
47+
working-directory: ./e2e_tests
48+
49+
tests:
50+
needs: [build, lint]
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v3
54+
- uses: ./.github/actions/cache-npm
55+
with:
56+
cache-key: npm
57+
58+
- name: Download Interlay runtime
59+
uses: actions/download-artifact@v4
60+
with:
61+
name: interlay-runtime
62+
path: ./e2e_tests/artifacts
63+
64+
- name: Detect runtime path
65+
id: runtime
66+
run: |
67+
find ./artifacts
68+
wasm=$(find ./artifacts -type f -name '*.wasm' | head -n1)
69+
echo "Found runtime wasm: $wasm"
70+
echo "wasm_path=$wasm" >> $GITHUB_OUTPUT
71+
working-directory: ./e2e_tests
72+
73+
- name: Use Node.js
74+
uses: actions/setup-node@v4
75+
with:
76+
node-version: 'lts/*'
77+
78+
- name: Install npm-dependencies
79+
run: |
80+
npm install
81+
working-directory: ./e2e_tests
82+
83+
- name: Run chopsticks
84+
env:
85+
WASM_PATH: ${{ steps.runtime.outputs.wasm_path }}
86+
run: |
87+
npx @acala-network/chopsticks xcm \
88+
-r chopsticks_configs/polkadot.yml \
89+
-p chopsticks_configs/interlay.yml \
90+
-p chopsticks_configs/polkadot_ah.yml \
91+
-p hydradx &
92+
echo "Chopsticks started"
93+
working-directory: ./e2e_tests
94+
95+
- name: Wait for chopsticks
96+
run: |
97+
timeout 36 sh -c 'until nc -z $0 $1; do echo -n .; sleep 1; done' localhost 8000
98+
99+
- name: Run tests
100+
run: |
101+
npm run test
102+
working-directory: ./e2e_tests

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ genesis-wasm
1919
rococo-local.json
2020
rococo-local-raw.json
2121

22+
## Node
23+
node_modules
24+
2225
*.log
2326

2427
### Testdata
25-
data/bitcoin-testdata.json
28+
data/bitcoin-testdata.json

e2e_tests/.prettierrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
printWidth: 120,
3+
useTabs: true,
4+
tabWidth: 4,
5+
};
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
endpoint: wss://rpc-interlay.luckyfriday.io/
2+
mock-signature-host: true
3+
db: ./interlay.db.sqlite
4+
runtime-log-level: 5
5+
wasm-override: ${env.WASM_PATH}
6+
7+
import-storage:
8+
Sudo:
9+
Key: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
10+
Tokens:
11+
Accounts:
12+
-
13+
-
14+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Alice
15+
- token: INTR
16+
- free: '100000000000000000000000000000'
17+
-
18+
-
19+
- 5Eg2fntQqFi3EvFWAf71G66Ecjjah26bmFzoANAeHFgj9Lia # Hydration SA
20+
- token: INTR
21+
- free: '100000000000000000000000000000'
22+
-
23+
-
24+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
25+
- token: IBTC
26+
- free: '2100000000000000'
27+
-
28+
-
29+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
30+
- token: DOT
31+
- free: '100000000000000000000000000000'
32+
-
33+
-
34+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
35+
- token: KINT
36+
- free: '100000000000000000000000000000'
37+
-
38+
-
39+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
40+
- token: KBTC
41+
- free: '100000000000000000000000000000'
42+
-
43+
-
44+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
45+
- token: KSM
46+
- free: '100000000000000000000000000000'
47+
-
48+
-
49+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
50+
- ForeignAsset: 1 # LDOT (Acala)
51+
- free: '100000000000000000000000000000'
52+
-
53+
-
54+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
55+
- ForeignAsset: 2 # USDT (native from AssetHub)
56+
- free: '100000000000000000000000000000'
57+
-
58+
-
59+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
60+
- ForeignAsset: 3 # VDOT
61+
- free: '100000000000000000000000000000'
62+
-
63+
-
64+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
65+
- ForeignAsset: 4 # DAI.wh
66+
- free: '100000000000000000000000000000'
67+
-
68+
-
69+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
70+
- ForeignAsset: 5 # tBTC
71+
- free: '2100000000000000'
72+
-
73+
-
74+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
75+
- ForeignAsset: 6 # WETH.wh
76+
- free: '100000000000000000000000000000'
77+
-
78+
-
79+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
80+
- ForeignAsset: 7 # WBNB.wh
81+
- free: '100000000000000000000000000000'
82+
-
83+
-
84+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
85+
- ForeignAsset: 8 # USDC.wh
86+
- free: '100000000000000000000000000000'
87+
-
88+
-
89+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
90+
- ForeignAsset: 9 # WBTC.wh
91+
- free: '2100000000000000'
92+
-
93+
-
94+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
95+
- ForeignAsset: 10 # GLMR
96+
- free: '100000000000000000000000000000'
97+
-
98+
-
99+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
100+
- ForeignAsset: 11 # BNC
101+
- free: '100000000000000000000000000000'
102+
-
103+
-
104+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
105+
- ForeignAsset: 12 # USDC (native from AssetHub)
106+
- free: '100000000000000000000000000000'
107+
-
108+
-
109+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
110+
- ForeignAsset: 13 # HDX (HydraDX)
111+
- free: '100000000000000000000000000000'
112+
-
113+
-
114+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
115+
- LendToken: 1 # qIBTC (loan token for iBTC)
116+
- free: '100000000000000000000000000000'
117+
-
118+
-
119+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
120+
- LendToken: 2 # qDOT (loan token for DOT)
121+
- free: '100000000000000000000000000000'
122+
-
123+
-
124+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
125+
- LendToken: 3 # qUSDT (loan token for native USDT)
126+
- free: '100000000000000000000000000000'
127+
-
128+
-
129+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
130+
- LendToken: 4 # qVDOT (loan token for VDOT)
131+
- free: '100000000000000000000000000000'
132+
-
133+
-
134+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
135+
- LendToken: 5 # qUSDC (loan token for native USDC)
136+
- free: '100000000000000000000000000000'
137+
-
138+
-
139+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
140+
- LendToken: 6 # qHDX (loan token for HDX)
141+
- free: '100000000000000000000000000000'
142+
-
143+
-
144+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
145+
- LendToken: 7 # qBNC (loan token for BNC)
146+
- free: '100000000000000000000000000000'
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
endpoint:
2+
- wss://rpc.ibp.network/polkadot
3+
- wss://polkadot-rpc.dwellir.com
4+
mock-signature-host: true
5+
db: ./db.sqlite
6+
runtime-log-level: 5
7+
8+
import-storage:
9+
System:
10+
Account:
11+
-
12+
-
13+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY #Alice
14+
- providers: 1
15+
data:
16+
free: '10000000000000000000'
17+
-
18+
-
19+
- 5Ec4AhPbkXX97KXMcf9v9SkRNG4Gyc3VhcMMuQe9QXfAHnrC # Hydration SA
20+
- providers: 1
21+
data:
22+
free: '10000000000000000000'
23+
-
24+
-
25+
- 5Ec4AhPbMHQn55fjyQCTm5UHAzjSgtBFWBuieCK2DwbDqGSG # Interlay SA
26+
- providers: 1
27+
data:
28+
free: '10000000000000000000'
29+
ParasDisputes:
30+
$removePrefix: ['disputes'] # those can makes block building super slow
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
endpoint: wss://polkadot-asset-hub-rpc.polkadot.io
2+
mock-signature-host: true
3+
db: ./db.sqlite
4+
5+
import-storage:
6+
System:
7+
Account:
8+
-
9+
-
10+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Alice
11+
- providers: 1
12+
data:
13+
free: 1000000000000000
14+
-
15+
-
16+
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Hydration SA
17+
- providers: 1
18+
data:
19+
free: 1000000000000000
20+
-
21+
-
22+
- 5Eg2fntQS1bgCgPtXQ9Ysip6RUQkQJEMZqZ9u9qX6fcnhB4H # Interlay SA
23+
- providers: 1
24+
data:
25+
free: 1000000000000000
26+
Assets:
27+
Account:
28+
- [[1984, 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { balance: 1000000000 }]
29+
- [[1337, 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { balance: 1000000000 }]
30+
- [[21, 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { balance: 1000000000 }]
31+
Asset: [[[21], { supply: 1000000000 }]]

0 commit comments

Comments
 (0)