-
Notifications
You must be signed in to change notification settings - Fork 15
add integritee tests #287
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
Merged
xlc
merged 15 commits into
open-web3-stack:master
from
integritee-network:ab/add-integritee-tests
Jun 24, 2025
Merged
add integritee tests #287
Changes from 4 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f4280d8
add first integritee tests
brenzi b735a0d
tests for integritee and AH
brenzi 74f8639
fixes
brenzi ed71875
cleanup
brenzi 17cfab8
fixes AssetId vs Location
brenzi 890908b
fix endowment
brenzi 890b141
experiments
brenzi cd08c08
test
brenzi 5a500e5
test
brenzi 1d92d7f
working minimal tests
brenzi f7c4dec
cleanup
brenzi f8b77b3
fix
brenzi 678ccca
add snapshot files
brenzi 5b7362d
fix tests and update snapshots
brenzi 14bc2dc
fix polkadot testing amount
brenzi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import { describe } from 'vitest' | ||
|
|
||
| import { assetHubKusama, integriteeKusama } from '@e2e-test/networks/chains' | ||
| import { setupNetworks } from '@e2e-test/shared' | ||
| import { query, tx } from '@e2e-test/shared/api' | ||
| import { runXcmPalletHorizontal } from '@e2e-test/shared/xcm' | ||
|
|
||
| describe('integriteeKusama & assetHubKusama', async () => { | ||
| const [assetHubKusamaClient, integriteeKusamaClient] = await setupNetworks(assetHubKusama, integriteeKusama) | ||
|
|
||
| const integriteeKSM = integriteeKusama.custom.relayNative | ||
| const kusamaKSM = assetHubKusama.custom.ksm | ||
|
|
||
| const integriteeTEER = integriteeKusama.custom.teerK | ||
| const assetHubTEER = { Concrete: { parents: 1, interior: { X1: [{ Parachain: integriteeKusama.paraId! }] } } } | ||
|
|
||
| runXcmPalletHorizontal('assetHubKusama transfer KSM to integriteeKusama', async () => { | ||
| return { | ||
| fromChain: assetHubKusamaClient, | ||
| toChain: integriteeKusamaClient, | ||
| fromBalance: query.balances, | ||
| toBalance: query.assets(integriteeKSM), | ||
| tx: tx.xcmPallet.limitedReserveTransferAssetsV3( | ||
| kusamaKSM, | ||
| 1e12, | ||
| tx.xcmPallet.parachainV3(1, integriteeKusama.paraId!), | ||
| ), | ||
| } | ||
| }) | ||
|
|
||
| runXcmPalletHorizontal('integriteeKusama transfer KSM to assetHubKusama', async () => { | ||
| return { | ||
| fromChain: integriteeKusamaClient, | ||
| toChain: assetHubKusamaClient, | ||
| fromBalance: query.assets(integriteeKSM), | ||
| toBalance: query.balances, | ||
| tx: tx.xcmPallet.limitedReserveTransferAssetsV3( | ||
| integriteeKSM, | ||
| 1e12, | ||
| tx.xcmPallet.parachainV3(1, assetHubKusama.paraId!), | ||
| ), | ||
| } | ||
| }) | ||
|
|
||
| runXcmPalletHorizontal('integriteeKusama transfer TEER to assetHubKusama', async () => { | ||
| return { | ||
| fromChain: integriteeKusamaClient, | ||
| toChain: assetHubKusamaClient, | ||
| fromBalance: query.balances, | ||
| toBalance: query.foreignAssets(assetHubTEER), | ||
| tx: tx.xcmPallet.limitedTeleportAssets(integriteeTEER, 1e12, tx.xcmPallet.parachainV3(1, assetHubKusama.paraId!)), | ||
| } | ||
| }) | ||
|
|
||
| runXcmPalletHorizontal('assetHubKusama transfer TEER to integriteeKusama', async () => { | ||
| return { | ||
| fromChain: assetHubKusamaClient, | ||
| toChain: integriteeKusamaClient, | ||
| fromBalance: query.foreignAssets(assetHubTEER), | ||
| toBalance: query.balances, | ||
| tx: tx.xcmPallet.limitedTeleportAssets(assetHubTEER, 1e12, tx.xcmPallet.parachainV3(1, integriteeKusama.paraId!)), | ||
| } | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { defaultAccounts } from '../defaultAccounts.js' | ||
| import { defineChain } from '../defineChain.js' | ||
|
|
||
| const custom = { | ||
| integriteePolkadot: { | ||
| teerP: { Concrete: { parents: 0, interior: 'Here' } }, | ||
| relayNative: 0, | ||
| }, | ||
| integriteeKusama: { | ||
| teerK: { Concrete: { parents: 0, interior: 'Here' } }, | ||
| relayNative: 0, | ||
| }, | ||
| } | ||
|
|
||
| const getInitStorages = (config: typeof custom.integriteePolkadot | typeof custom.integriteeKusama) => ({ | ||
| System: { | ||
| account: [[[defaultAccounts.alice.address], { providers: 1, data: { free: 1000e10 } }]], | ||
| }, | ||
| Assets: { | ||
| account: [[[config.relayNative, defaultAccounts.alice.address], { balance: 1000e12 }]], | ||
| }, | ||
| }) | ||
|
|
||
| export const integriteePolkadot = defineChain({ | ||
| name: 'integritee-polkadot', | ||
| paraId: 2039, | ||
| endpoint: 'wss://polkadot.api.integritee.network', | ||
| custom: custom.integriteePolkadot, | ||
| initStorages: getInitStorages(custom.integriteePolkadot), | ||
| }) | ||
|
|
||
| export const integriteeKusama = defineChain({ | ||
| name: 'integritee-kusama', | ||
| paraId: 2015, | ||
| endpoint: 'wss://polkadot.api.integritee.network', | ||
| custom: custom.integriteeKusama, | ||
| initStorages: getInitStorages(custom.integriteeKusama), | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| import { describe } from 'vitest' | ||
|
|
||
| import { assetHubPolkadot, integriteePolkadot } from '@e2e-test/networks/chains' | ||
| import { setupNetworks } from '@e2e-test/shared' | ||
| import { query, tx } from '@e2e-test/shared/api' | ||
| import { runXcmPalletHorizontal } from '@e2e-test/shared/xcm' | ||
|
|
||
| describe('integriteePolkadot & assetHubPolkadot', async () => { | ||
| const [assetHubPolkadotClient, integriteePolkadotClient] = await setupNetworks(assetHubPolkadot, integriteePolkadot) | ||
|
|
||
| const integriteeDOT = integriteePolkadot.custom.relayNative | ||
| const polkadotDOT = assetHubPolkadot.custom.dot | ||
|
|
||
| const integriteeTEER = integriteePolkadot.custom.teerP | ||
| const assetHubTEER = { Concrete: { parents: 1, interior: { X1: [{ Parachain: integriteePolkadot.paraId! }] } } } | ||
|
|
||
| runXcmPalletHorizontal('assetHubPolkadot transfer DOT to integriteePolkadot', async () => { | ||
| return { | ||
| fromChain: assetHubPolkadotClient, | ||
| toChain: integriteePolkadotClient, | ||
| fromBalance: query.balances, | ||
| toBalance: query.assets(integriteeDOT), | ||
| tx: tx.xcmPallet.limitedReserveTransferAssetsV3( | ||
| polkadotDOT, | ||
| 1e12, | ||
| tx.xcmPallet.parachainV3(1, integriteePolkadot.paraId!), | ||
| ), | ||
| } | ||
| }) | ||
|
|
||
| runXcmPalletHorizontal('integriteePolkadot transfer DOT to assetHubPolkadot', async () => { | ||
| return { | ||
| fromChain: integriteePolkadotClient, | ||
| toChain: assetHubPolkadotClient, | ||
| fromBalance: query.assets(integriteeDOT), | ||
| toBalance: query.balances, | ||
| tx: tx.xcmPallet.limitedReserveTransferAssetsV3( | ||
| integriteeDOT, | ||
brenzi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 1e12, | ||
| tx.xcmPallet.parachainV3(1, assetHubPolkadot.paraId!), | ||
| ), | ||
| } | ||
| }) | ||
|
|
||
| runXcmPalletHorizontal('integriteePolkadot transfer TEER to assetHubPolkadot', async () => { | ||
| return { | ||
| fromChain: integriteePolkadotClient, | ||
| toChain: assetHubPolkadotClient, | ||
| fromBalance: query.balances, | ||
| toBalance: query.foreignAssets(assetHubTEER), | ||
| tx: tx.xcmPallet.limitedTeleportAssets( | ||
| integriteeTEER, | ||
| 1e12, | ||
| tx.xcmPallet.parachainV3(1, assetHubPolkadot.paraId!), | ||
| ), | ||
| } | ||
| }) | ||
|
|
||
| runXcmPalletHorizontal('assetHubPolkadot transfer TEER to integriteePolkadot', async () => { | ||
| return { | ||
| fromChain: assetHubPolkadotClient, | ||
| toChain: integriteePolkadotClient, | ||
| fromBalance: query.foreignAssets(assetHubTEER), | ||
| toBalance: query.balances, | ||
| tx: tx.xcmPallet.limitedTeleportAssets( | ||
| assetHubTEER, | ||
| 1e12, | ||
| tx.xcmPallet.parachainV3(1, integriteePolkadot.paraId!), | ||
| ), | ||
| } | ||
| }) | ||
| }) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.