Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft] Chopsticks tests with papi and local nodes #6572

Draft
wants to merge 27 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4c2d063
added chopsticks folder with set-up and tests
x3c41a Nov 21, 2024
33c3a09
added bridge-hub config + improved readme
x3c41a Nov 21, 2024
eed6aaf
added xcm v4 initiate teleport test
x3c41a Nov 21, 2024
799d65c
implemented teleport in xcm v5 manner
x3c41a Nov 25, 2024
d663799
Merge branch 'master' into papi_chopsticks_docs
x3c41a Nov 25, 2024
5e677de
added message weighing before execution for XCM v5
x3c41a Nov 25, 2024
443fc85
added message weighing before execution for XCM v4 as well
x3c41a Nov 25, 2024
274debb
WIP: query_xcm_weight_to_asset_fee estimates wrongly
x3c41a Nov 26, 2024
6d11b52
added initiate teleport with remote fees program
x3c41a Nov 27, 2024
2ddb163
used wildcard instead of concrete fungible values in DepositAsset ins…
x3c41a Nov 27, 2024
7041b1e
removed commented config
x3c41a Nov 28, 2024
b7cd891
fixed bridge hub endpoint from polkadot to westend (#6914)
x3c41a Dec 16, 2024
2c236f4
Merge branch 'master' into papi_chopsticks_docs
x3c41a Dec 16, 2024
16b02fd
Added Asset issuance config (#6927)
x3c41a Dec 17, 2024
83b7509
Created sovereign account of penpal on asset hub and topped it up (#6…
x3c41a Dec 18, 2024
bd753b2
Added reserve asset transfer scenario (#7149)
x3c41a Jan 14, 2025
b86c14c
Initiate reserve withdraw test scenario (#7175)
x3c41a Jan 15, 2025
d94417f
Add more scenarios for Teleport and Teleport+Transact
tiagobndr Jan 15, 2025
c169a6e
Unified XCM v4 and v5 message creation (#7312)
x3c41a Jan 24, 2025
69dcbff
added relay chain API
x3c41a Jan 24, 2025
5083a77
1. Added new block generation. 2. Improved first Teleport test to che…
x3c41a Jan 24, 2025
b090a5a
updated test command in readme with increased per-test timeout
x3c41a Jan 24, 2025
3cd4290
Extracted config variables to config.ts, utility functions - to util.…
x3c41a Jan 27, 2025
52b66c3
removed commented lines
x3c41a Jan 27, 2025
785cdad
added assets deposit together with balance check to XCM v4 Teleport
x3c41a Jan 27, 2025
258131d
added balance check to Initiate Teleport v5
x3c41a Jan 27, 2025
937369d
added initial network set-up. test in progress
x3c41a Jan 31, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This folder serves as a reference documentation for chopstick tests and the Parity-owned ecosystems.
It provides a working set of configuration files together with the WASM BLOBs, specifically for the Westend ecosystem.
For additional resources and original Acala configuration files, including documentation, refer to the [Acala repository](https://github.com/AcalaNetwork/chopsticks/tree/master/configs) or [Papermoon chopsticks overview](https://papermoonio.github.io/polkadot-ecosystem-docs-draft/dev-tools/chopsticks/overview/#using-a-configuration-file)

Config files, especially `wasm-override:` fields there, assume that there is a `wasms` folder within the same parent directory, and it contains pre-built WASM BLOBs of the
ecosystem under tests.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
endpoint: wss://asset-hub-westend-rpc.dwellir.com
mock-signature-host: true
#block: ${env.WESTEND_ASSET_HUB_BLOCK_NUMBER}
db: ./db.sqlite
runtime-log-level: 5
wasm-override: wasms/asset_hub_westend_runtime.compact.compressed.wasm

import-storage:
PolkadotXcm:
SafeXcmVersion: 5
System:
Account:
[
[[5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { providers: 1, data: { free: 1000000000000000 } }], # Alice
[[5Eg2fntQqFi3EvFWAf71G66Ecjjah26bmFzoANAeHFgj9Lia], { providers: 1, data: { free: 1000000000000000 } }],
[[5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty], { providers: 1, data: { free: 1000000000000000 } }] # Bob
]
Assets:
Account:
- [[1984, 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { balance: 1000000000 }]
- [[1984, 5Eg2fntSSE9VPsfxjgvpoZCoPo2uquZaYwmNDDV91bxUxEt7], { balance: 1000000000 }] # SA of Penpal chain

Asset:
[
[[1984], { supply: 4000000000 }],
]


Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
endpoint: wss://bridge-hub-westend-rpc.dwellir.com
mock-signature-host: true
block: ${env.WESTEND_BRIDGE_HUB_BLOCK_NUMBER}
db: ./db.sqlite
runtime-log-level: 5
wasm-override: wasms/bridge_hub_westend_runtime.compact.compressed.wasm

import-storage:
System:
Account:
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Alice
- providers: 1
data:
free: 1000000000000000
-
-
- 5Eg2fntQqFi3EvFWAf71G66Ecjjah26bmFzoANAeHFgj9Lia
- providers: 1
data:
free: 1000000000000000
-
-
- 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty # Bob
- providers: 1
data:
free: 1000000000000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
endpoint:
- wss://westend-rpc.dwellir.com
mock-signature-host: true
block: ${env.WESTEND_BLOCK_NUMBER}
db: ./db.sqlite
runtime-log-level: 5
wasm-override: wasms/westend_runtime.compact.compressed.wasm

import-storage:
XcmPallet:
SafeXcmVersion: 5
System:
Account:
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- providers: 1
data:
free: '10000000000000000000'
ParasDisputes:
$removePrefix: ['disputes']
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
endpoint: wss://westend-penpal-rpc.polkadot.io
mock-signature-host: true
db: ./db.sqlite
runtime-log-level: 5
wasm-override: wasms/penpal_runtime.compact.compressed.wasm

import-storage:
PolkadotXcm:
SafeXcmVersion: 5
System:
Account:
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Alice
- providers: 1
data:
free: 1000000000000000
-
-
- 5Eg2fntQqFi3EvFWAf71G66Ecjjah26bmFzoANAeHFgj9Lia
- providers: 1
data:
free: 1000000000000000
-
-
- 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty # Bob
- providers: 1
data:
free: 1000000000000000
Assets:
Account:
- [[1984, 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { balance: 1000000000 }]
- [[1984, 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty], { balance: 1000000000 }] # Bob
Asset: [[[1984], { supply: 1000000000 }]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
endpoint: wss://people-westend-rpc.dwellir.com
mock-signature-host: true
# block: ${env.WESTEND_PEOPLE_BLOCK_NUMBER}
db: ./db.sqlite
runtime-log-level: 5
wasm-override: wasms/people_westend_runtime.compact.compressed.wasm

import-storage:
PolkadotXcm:
SafeXcmVersion: 5
System:
Account:
- - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Alice
- providers: 1
data:
free: 1000000000000000
- - - 5Eg2fntQqFi3EvFWAf71G66Ecjjah26bmFzoANAeHFgj9Lia
- providers: 1
data:
free: 1000000000000000
- - - 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty # Bob
- providers: 1
data:
free: 1000000000000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# v5-sac-test

To install dependencies:

```bash
bun add polkadot-api
# now you need to switch to another terminal window where you executed bunx command, make sure that chains are running and copy Asset Hub's port in the command below (usually the port is 8001).
bun papi add wnd_ah -w ws://localhost:8000
bun papi add wnd_penpal -w ws://localhost:8001
bun add @polkadot-labs/hdkd
```

To run the test:

```bash
# timeout per test. time in ms. during start-up it takes around 11 sec for test to be executed
bun test ./index.ts --timeout 12000
# note: the test may time out during the first run. Single retry usually helps.
```

This project was created using `bun init` in bun v1.1.34. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const CONFIG = {
WESTEND_NETWORK: Uint8Array.from([
225, 67, 242, 56, 3, 172, 80, 232, 246, 248, 230, 38, 149, 209, 206, 158,
78, 29, 104, 170, 54, 193, 205, 44, 253, 21, 52, 2, 19, 243, 66, 62,
]),
KEYS: {
BOB: "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",
ALICE: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
},
WS_ADDRESSES: {
AH: "wss://westend-asset-hub-rpc.polkadot.io",
PENPAL: "wss://westend-penpal-rpc.polkadot.io",
RC: "wss://westend-rpc.polkadot.io",
},
};
Loading
Loading