Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: AHM e2e tests
  • Loading branch information
tsenovilla committed Oct 15, 2025
commit 36d1e1c72d19178e10cfb74caeb04be9a727fb25
20 changes: 20 additions & 0 deletions .github/actions/cache-npm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Cache NPM'
description: 'Caching npm dependencies'
inputs:
cache-key:
description: 'Key to use when caching npm dependencies'
required: true
default: 'npm-default'
runs:
using: "composite"
steps:
- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-npm-${{ inputs.cache-key }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-${{ inputs.cache-key }}-
${{ runner.os }}-npm-
102 changes: 102 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: E2E Tests

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Build Interlay runtime
id: srtool_build
uses: paritytech/[email protected]
with:
package: interlay-runtime-parachain
runtime_dir: parachain/runtime/interlay
chain: interlay
- name: Save Interlay runtime
uses: actions/upload-artifact@v4
with:
name: interlay-runtime
path: |
${{ steps.srtool_build.outputs.wasm_compressed }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/cache-npm
with:
cache-key: npm

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- name: Install npm-dependencies
run: |
npm install
working-directory: ./e2e_tests

- name: Run lint
run: |
npm run fmt-check
working-directory: ./e2e_tests

tests:
needs: [build, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/cache-npm
with:
cache-key: npm

- name: Download Interlay runtime
uses: actions/download-artifact@v4
with:
name: interlay-runtime
path: ./e2e_tests/artifacts

- name: Detect runtime path
id: runtime
run: |
find ./artifacts
wasm=$(find ./artifacts -type f -name '*.wasm' | head -n1)
echo "Found runtime wasm: $wasm"
echo "wasm_path=$wasm" >> $GITHUB_OUTPUT
working-directory: ./e2e_tests

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- name: Install npm-dependencies
run: |
npm install
working-directory: ./e2e_tests

- name: Run chopsticks
env:
WASM_PATH: ${{ steps.runtime.outputs.wasm_path }}
run: |
npx @acala-network/chopsticks xcm \
-r chopsticks_configs/polkadot.yml \
-p chopsticks_configs/interlay.yml \
-p chopsticks_configs/polkadot_ah.yml \
-p hydradx &
echo "Chopsticks started"
working-directory: ./e2e_tests

- name: Wait for chopsticks
run: |
timeout 36 sh -c 'until nc -z $0 $1; do echo -n .; sleep 1; done' localhost 8000

- name: Run tests
run: |
npm run test
working-directory: ./e2e_tests
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ genesis-wasm
rococo-local.json
rococo-local-raw.json

## Node
node_modules

*.log

### Testdata
data/bitcoin-testdata.json
data/bitcoin-testdata.json
5 changes: 5 additions & 0 deletions e2e_tests/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
printWidth: 120,
useTabs: true,
tabWidth: 4,
};
146 changes: 146 additions & 0 deletions e2e_tests/chopsticks_configs/interlay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
endpoint: wss://rpc-interlay.luckyfriday.io/
mock-signature-host: true
db: ./interlay.db.sqlite
runtime-log-level: 5
wasm-override: ${env.WASM_PATH}

import-storage:
Sudo:
Key: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
Tokens:
Accounts:
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Alice
- token: INTR
- free: '100000000000000000000000000000'
-
-
- 5Eg2fntQqFi3EvFWAf71G66Ecjjah26bmFzoANAeHFgj9Lia # Hydration SA
- token: INTR
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- token: IBTC
- free: '2100000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- token: DOT
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- token: KINT
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- token: KBTC
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- token: KSM
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 1 # LDOT (Acala)
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 2 # USDT (native from AssetHub)
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 3 # VDOT
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 4 # DAI.wh
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 5 # tBTC
- free: '2100000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 6 # WETH.wh
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 7 # WBNB.wh
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 8 # USDC.wh
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 9 # WBTC.wh
- free: '2100000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 10 # GLMR
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 11 # BNC
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 12 # USDC (native from AssetHub)
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- ForeignAsset: 13 # HDX (HydraDX)
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- LendToken: 1 # qIBTC (loan token for iBTC)
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- LendToken: 2 # qDOT (loan token for DOT)
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- LendToken: 3 # qUSDT (loan token for native USDT)
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- LendToken: 4 # qVDOT (loan token for VDOT)
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- LendToken: 5 # qUSDC (loan token for native USDC)
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- LendToken: 6 # qHDX (loan token for HDX)
- free: '100000000000000000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- LendToken: 7 # qBNC (loan token for BNC)
- free: '100000000000000000000000000000'
30 changes: 30 additions & 0 deletions e2e_tests/chopsticks_configs/polkadot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
endpoint:
- wss://rpc.ibp.network/polkadot
- wss://polkadot-rpc.dwellir.com
mock-signature-host: true
db: ./db.sqlite
runtime-log-level: 5

import-storage:
System:
Account:
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY #Alice
- providers: 1
data:
free: '10000000000000000000'
-
-
- 5Ec4AhPbkXX97KXMcf9v9SkRNG4Gyc3VhcMMuQe9QXfAHnrC # Hydration SA
- providers: 1
data:
free: '10000000000000000000'
-
-
- 5Ec4AhPbMHQn55fjyQCTm5UHAzjSgtBFWBuieCK2DwbDqGSG # Interlay SA
- providers: 1
data:
free: '10000000000000000000'
ParasDisputes:
$removePrefix: ['disputes'] # those can makes block building super slow
31 changes: 31 additions & 0 deletions e2e_tests/chopsticks_configs/polkadot_ah.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
endpoint: wss://polkadot-asset-hub-rpc.polkadot.io
mock-signature-host: true
db: ./db.sqlite

import-storage:
System:
Account:
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Alice
- providers: 1
data:
free: 1000000000000000
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Hydration SA
- providers: 1
data:
free: 1000000000000000
-
-
- 5Eg2fntQS1bgCgPtXQ9Ysip6RUQkQJEMZqZ9u9qX6fcnhB4H # Interlay SA
- providers: 1
data:
free: 1000000000000000
Assets:
Account:
- [[1984, 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { balance: 1000000000 }]
- [[1337, 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { balance: 1000000000 }]
- [[21, 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { balance: 1000000000 }]
Asset: [[[21], { supply: 1000000000 }]]
Loading