Skip to content

Commit

Permalink
test both polkadot and kusama
Browse files Browse the repository at this point in the history
  • Loading branch information
samelamin committed Sep 9, 2023
1 parent 314b293 commit 3b0d699
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/chopsticks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@ jobs:
- name: Run tests
env:
KUSAMA_WASM: "../target/release/wbuild/kusama-runtime/kusama_runtime.compact.compressed.wasm"
POLKADOT_WASM: "../target/release/wbuild/polkadot-runtime/polkadot_runtime.compact.compressed.wasm"
STATEMINE_WASM: "../target/release/wbuild/asset-hub-kusama-runtime/asset_hub_kusama_runtime.compact.compressed.wasm"
STATEMINT_WASM: "../target/release/wbuild/asset-hub-polkadot-runtime/asset_hub_polkadot_runtime.compact.compressed.wasm"
run: find e2e-tests/tests/ -name '*.test.*' | xargs rm -rf && cp -r chopsticks/* e2e-tests/tests/ && yarn --cwd e2e-tests test
19 changes: 8 additions & 11 deletions chopsticks/xcm-transfer/__snapshots__/kusama-assethub.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ exports[`'kusama' -> 'statemine' xcm transfer 'KSM' > xcmPallet transfer > balan
{
"consumers": 0,
"data": {
"flags": 0,
"free": 10000000000000,
"flags": "0x80000000000000000000000000000000",
"free": "(rounded 11000000000000)",
"frozen": 0,
"reserved": 0,
},
Expand All @@ -44,13 +44,10 @@ exports[`'kusama' -> 'statemine' xcm transfer 'KSM' > xcmPallet transfer > to ch
"messageHash": "(hash)",
"messageId": "(hash)",
"outcome": {
"Incomplete": [
{
"proofSize": 0,
"refTime": 1000000000,
},
"UntrustedReserveLocation",
],
"Complete": {
"proofSize": 0,
"refTime": "(rounded 170000000)",
},
},
},
"method": "ExecutedDownward",
Expand All @@ -61,7 +58,7 @@ exports[`'kusama' -> 'statemine' xcm transfer 'KSM' > xcmPallet transfer > to ch
"dmqHead": "(hash)",
"weightUsed": {
"proofSize": 0,
"refTime": 1000000000,
"refTime": "(rounded 170000000)",
},
},
"method": "DownwardMessagesProcessed",
Expand All @@ -77,7 +74,7 @@ exports[`'kusama' -> 'statemine' xcm transfer 'KSM' > xcmPallet transfer > tx ev
"outcome": {
"Complete": {
"proofSize": 0,
"refTime": "(rounded 753000000)",
"refTime": "(rounded 764000000)",
},
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`'polkadot' -> 'statemint' xcm transfer 'DOT' > xcmPallet transfer > balance on from chain 1`] = `
{
"consumers": 0,
"data": {
"flags": "0x80000000000000000000000000000000",
"free": "(rounded 9000000000000)",
"frozen": 0,
"reserved": 0,
},
"nonce": 1,
"providers": 1,
"sufficients": 0,
}
`;

exports[`'polkadot' -> 'statemint' xcm transfer 'DOT' > xcmPallet transfer > balance on to chain 1`] = `
{
"consumers": 0,
"data": {
"flags": "0x80000000000000000000000000000000",
"free": "(rounded 11000000000000)",
"frozen": 0,
"reserved": 0,
},
"nonce": 0,
"providers": 1,
"sufficients": 0,
}
`;

exports[`'polkadot' -> 'statemint' xcm transfer 'DOT' > xcmPallet transfer > to chain dmp events 1`] = `
[
{
"data": {
"count": 1,
},
"method": "DownwardMessagesReceived",
"section": "parachainSystem",
},
{
"data": {
"messageId": "(hash)",
"outcome": {
"Complete": {
"proofSize": 0,
"refTime": "(rounded 160000000)",
},
},
},
"method": "ExecutedDownward",
"section": "dmpQueue",
},
{
"data": {
"dmqHead": "(hash)",
"weightUsed": {
"proofSize": 0,
"refTime": "(rounded 160000000)",
},
},
"method": "DownwardMessagesProcessed",
"section": "parachainSystem",
},
]
`;

exports[`'polkadot' -> 'statemint' xcm transfer 'DOT' > xcmPallet transfer > tx events 1`] = `
[
{
"data": [
{
"Complete": {
"proofSize": 0,
"refTime": 3000000000,
},
},
],
"method": "Attempted",
"section": "xcmPallet",
},
]
`;
4 changes: 2 additions & 2 deletions chopsticks/xcm-transfer/kusama-assethub.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { query, tx } from '../../helpers/api'

import { kusama } from '../../networks/polkadot'
import { statemine, statemint } from '../../networks/statemint'
import { statemine } from '../../networks/statemint'

import buildTest from './shared'

Expand All @@ -12,7 +12,7 @@ const tests = [
name: 'KSM',
test: {
xcmPalletDown: {
tx: tx.xcmPallet.limitedReserveTransferAssetsV3(kusama.ksm, 1e12, tx.xcmPallet.parachainV3(0, statemine.paraId)),
tx: tx.xcmPallet.teleportAssets(kusama.ksm, 1e12, tx.xcmPallet.parachainV3(0, statemine.paraId)),
balance: query.balances,
},
},
Expand Down
25 changes: 25 additions & 0 deletions chopsticks/xcm-transfer/polkadot-assethub.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { query, tx } from '../../helpers/api'

import { polkadot } from '../../networks/polkadot'
import { statemint } from '../../networks/statemint'

import buildTest from './shared'

const tests = [
{
from: 'polkadot',
to: 'statemint',
name: 'DOT',
test: {
xcmPalletDown: {
tx: tx.xcmPallet.teleportAssets(polkadot.dot, 1e12, tx.xcmPallet.parachainV3(0, statemint.paraId)),
balance: query.balances,
},
},
},
] as const


export type TestType = (typeof tests)[number]

buildTest(tests)

0 comments on commit 3b0d699

Please sign in to comment.