diff --git a/packages/networks/src/chains/assethub.ts b/packages/networks/src/chains/assethub.ts index 8949ecd23..745abd983 100644 --- a/packages/networks/src/chains/assethub.ts +++ b/packages/networks/src/chains/assethub.ts @@ -3,6 +3,7 @@ import { defineChain } from '../defineChain.js' const custom = { assetHubPolkadot: { + units: 1e10, dot: { Concrete: { parents: 1, interior: 'Here' } }, usdt: { Concrete: { parents: 0, interior: { X2: [{ PalletInstance: 50 }, { GeneralIndex: 1984 }] } } }, usdtIndex: 1984, @@ -22,6 +23,7 @@ const custom = { }, }, assetHubKusama: { + units: 1e10, ksm: { Concrete: { parents: 1, interior: 'Here' } }, usdt: { Concrete: { parents: 0, interior: { X2: [{ PalletInstance: 50 }, { GeneralIndex: 1984 }] } } }, usdtIndex: 1984, @@ -41,6 +43,7 @@ const custom = { }, }, assetHubWestend: { + units: 1e12, wnd: { Concrete: { parents: 1, interior: 'Here' } }, usdt: { Concrete: { parents: 0, interior: { X2: [{ PalletInstance: 50 }, { GeneralIndex: 1984 }] } } }, usdtIndex: 1984, @@ -55,22 +58,27 @@ const accountList = [ const getInitStorages = ( config: typeof custom.assetHubPolkadot | typeof custom.assetHubKusama | typeof custom.assetHubWestend, -) => ({ - System: { - account: [ - [[defaultAccounts.alice.address], { providers: 1, data: { free: 1000e10 } }], - [[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: 1000e10 } }], - ], - }, - Assets: { - account: [ - [[config.usdtIndex, defaultAccounts.alice.address], { balance: 1000e6 }], // USDT - ], - }, - ForeignAssets: { - account: config.eth ? accountList : [], - }, -}) +) => { + const baseAmount = 1000 + const amount = BigInt(baseAmount) * BigInt(config.units) + + return { + System: { + account: [ + [[defaultAccounts.alice.address], { providers: 1, data: { free: amount } }], + [[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: amount } }], + ], + }, + Assets: { + account: [ + [[config.usdtIndex, defaultAccounts.alice.address], { balance: 1000e6 }], // USDT + ], + }, + ForeignAssets: { + account: config.eth ? accountList : [], + }, + } +} export const assetHubPolkadot = defineChain({ name: 'assetHubPolkadot', diff --git a/packages/networks/src/chains/bridgehub.ts b/packages/networks/src/chains/bridgehub.ts index bc137ca1c..521c3b708 100644 --- a/packages/networks/src/chains/bridgehub.ts +++ b/packages/networks/src/chains/bridgehub.ts @@ -8,9 +8,14 @@ const custom = { bridgeHubKusama: { ksm: { Concrete: { parents: 1, interior: 'Here' } }, }, + bridgeHubWestend: { + wnd: { Concrete: { parents: 1, interior: 'Here' } }, + }, } -const getInitStorages = (_config: typeof custom.bridgeHubPolkadot | typeof custom.bridgeHubKusama) => ({ +const getInitStorages = ( + _config: typeof custom.bridgeHubPolkadot | typeof custom.bridgeHubKusama | typeof custom.bridgeHubWestend, +) => ({ System: { account: [[[defaultAccounts.alice.address], { providers: 1, data: { free: 1000e10 } }]], }, @@ -31,3 +36,11 @@ export const bridgeHubKusama = defineChain({ custom: custom.bridgeHubKusama, initStorages: getInitStorages(custom.bridgeHubKusama), }) + +export const bridgeHubWestend = defineChain({ + name: 'bridgeHubWestend', + endpoint: 'wss://westend-bridge-hub-rpc.polkadot.io', + paraId: 1002, + custom: custom.bridgeHubWestend, + initStorages: getInitStorages(custom.bridgeHubWestend), +}) diff --git a/packages/networks/src/chains/collectives.ts b/packages/networks/src/chains/collectives.ts index 949aa3de0..7059c03f0 100644 --- a/packages/networks/src/chains/collectives.ts +++ b/packages/networks/src/chains/collectives.ts @@ -3,22 +3,29 @@ import { defineChain } from '../defineChain.js' const custom = { collectivesPolkadot: { + units: 1e10, dot: { Concrete: { parents: 1, interior: 'Here' } }, }, collectivesWestend: { + units: 1e12, wnd: { Concrete: { parents: 1, interior: 'Here' } }, }, } -const getInitStorages = (_config: typeof custom.collectivesPolkadot | typeof custom.collectivesWestend) => ({ - System: { - account: [ - [[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: 1000e10 } }], - [[defaultAccounts.alice.address], { providers: 1, data: { free: 1000e10 } }], - [[defaultAccounts.bob.address], { providers: 1, data: { free: 1000e10 } }], - ], - }, -}) +const getInitStorages = (config: typeof custom.collectivesPolkadot | typeof custom.collectivesWestend) => { + const baseAmount = 1000 + const amount = BigInt(baseAmount) * BigInt(config.units) + + return { + System: { + account: [ + [[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: amount } }], + [[defaultAccounts.alice.address], { providers: 1, data: { free: amount } }], + [[defaultAccounts.bob.address], { providers: 1, data: { free: amount } }], + ], + }, + } +} export const collectivesPolkadot = defineChain({ name: 'collectivesPolkadot', diff --git a/packages/networks/src/chains/coretime.ts b/packages/networks/src/chains/coretime.ts index bc30eb8a2..c9e6a5e80 100644 --- a/packages/networks/src/chains/coretime.ts +++ b/packages/networks/src/chains/coretime.ts @@ -3,21 +3,34 @@ import { defineChain } from '../defineChain.js' const custom = { coretimePolkadot: { + units: 1e10, dot: { Concrete: { parents: 1, interior: 'Here' } }, }, coretimeKusama: { + units: 1e10, ksm: { Concrete: { parents: 1, interior: 'Here' } }, }, + coretimeWestend: { + units: 1e12, + wnd: { Concrete: { parents: 1, interior: 'Here' } }, + }, } -const getInitStorages = (_config: typeof custom.coretimePolkadot | typeof custom.coretimeKusama) => ({ - System: { - account: [ - [[defaultAccounts.alice.address], { providers: 1, data: { free: 1000e10 } }], - [[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: 1000e10 } }], - ], - }, -}) +const getInitStorages = ( + config: typeof custom.coretimePolkadot | typeof custom.coretimeKusama | typeof custom.coretimeWestend, +) => { + const baseAmount = 1000 + const amount = BigInt(baseAmount) * BigInt(config.units) + + return { + System: { + account: [ + [[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: amount } }], + [[defaultAccounts.alice.address], { providers: 1, data: { free: amount } }], + ], + }, + } +} export const coretimePolkadot = defineChain({ name: 'coretimePolkadot', @@ -34,3 +47,11 @@ export const coretimeKusama = defineChain({ custom: custom.coretimeKusama, initStorages: getInitStorages(custom.coretimeKusama), }) + +export const coretimeWestend = defineChain({ + name: 'coretimeWestend', + endpoint: 'wss://westend-coretime-rpc.polkadot.io', + paraId: 1005, + custom: custom.coretimeWestend, + initStorages: getInitStorages(custom.coretimeWestend), +}) diff --git a/packages/networks/src/chains/people.ts b/packages/networks/src/chains/people.ts index 8302292a1..628f20984 100644 --- a/packages/networks/src/chains/people.ts +++ b/packages/networks/src/chains/people.ts @@ -3,11 +3,17 @@ import { defineChain } from '../defineChain.js' const custom = { peoplePolkadot: { + units: 1e10, dot: { Concrete: { parents: 1, interior: 'Here' } }, }, peopleKusama: { + units: 1e10, ksm: { Concrete: { parents: 1, interior: 'Here' } }, }, + peopleWestend: { + units: 1e12, + wnd: { Concrete: { parents: 1, interior: 'Here' } }, + }, } const aliceRegistrar = { @@ -22,20 +28,27 @@ const bobRegistrar = { fields: 0, } -const getInitStorages = (_config: typeof custom.peoplePolkadot | typeof custom.peopleKusama) => ({ - System: { - account: [ - [[defaultAccounts.alice.address], { providers: 1, data: { free: 1000e10 } }], - [[defaultAccounts.bob.address], { providers: 1, data: { free: 1000e10 } }], - [[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: 1000e10 } }], - [[defaultAccountsSr25519.bob.address], { providers: 1, data: { free: 1000e10 } }], - ], - }, - // Registrars to be used in E2E tests - required to test `RegistrarOrigin`-locked extrinsics. - Identity: { - Registrars: [aliceRegistrar, bobRegistrar], - }, -}) +const getInitStorages = ( + config: typeof custom.peoplePolkadot | typeof custom.peopleKusama | typeof custom.peopleWestend, +) => { + const baseAmount = 1000 + const amount = BigInt(baseAmount) * BigInt(config.units) + + return { + System: { + account: [ + [[defaultAccounts.alice.address], { providers: 1, data: { free: amount } }], + [[defaultAccounts.bob.address], { providers: 1, data: { free: amount } }], + [[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: amount } }], + [[defaultAccountsSr25519.bob.address], { providers: 1, data: { free: amount } }], + ], + }, + // Registrars to be used in E2E tests - required to test `RegistrarOrigin`-locked extrinsics. + Identity: { + Registrars: [aliceRegistrar, bobRegistrar], + }, + } +} export const peoplePolkadot = defineChain({ name: 'peoplePolkadot', @@ -52,3 +65,11 @@ export const peopleKusama = defineChain({ custom: custom.peopleKusama, initStorages: getInitStorages(custom.peopleKusama), }) + +export const peopleWestend = defineChain({ + name: 'peopleWestend', + endpoint: 'wss://westend-people-rpc.polkadot.io', + paraId: 1004, + custom: custom.peopleWestend, + initStorages: getInitStorages(custom.peopleWestend), +}) diff --git a/packages/networks/src/chains/polkadot.ts b/packages/networks/src/chains/polkadot.ts index d4c2f35de..e6829f6b5 100644 --- a/packages/networks/src/chains/polkadot.ts +++ b/packages/networks/src/chains/polkadot.ts @@ -3,38 +3,46 @@ import { defineChain } from '../defineChain.js' const custom = { polkadot: { + units: 1e10, dot: { Concrete: { parents: 0, interior: 'Here' } }, }, kusama: { + units: 1e10, ksm: { Concrete: { parents: 0, interior: 'Here' } }, }, westend: { + units: 1e12, wnd: { Concrete: { parents: 0, interior: 'Here' } }, }, } -const getInitStorages = () => ({ - System: { - Account: [ - [[defaultAccounts.alice.address], { providers: 1, data: { free: 1000 * 1e10 } }], - [[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: 1000 * 1e10 } }], - ], - }, - ParasDisputes: { - // these can makes block building super slow - $removePrefix: ['disputes'], - }, - Dmp: { - // clear existing dmp to avoid impacting test result - $removePrefix: ['downwardMessageQueues'], - }, -}) +const getInitStorages = (config: typeof custom.polkadot | typeof custom.kusama | typeof custom.westend) => { + const baseAmount = 1000 + const amount = BigInt(baseAmount) * BigInt(config.units) + + return { + System: { + Account: [ + [[defaultAccounts.alice.address], { providers: 1, data: { free: amount } }], + [[defaultAccountsSr25519.alice.address], { providers: 1, data: { free: amount } }], + ], + }, + ParasDisputes: { + // these can makes block building super slow + $removePrefix: ['disputes'], + }, + Dmp: { + // clear existing dmp to avoid impacting test result + $removePrefix: ['downwardMessageQueues'], + }, + } +} export const polkadot = defineChain({ name: 'polkadot', endpoint: 'wss://rpc.ibp.network/polkadot', custom: custom.polkadot, - initStorages: getInitStorages(), + initStorages: getInitStorages(custom.polkadot), isRelayChain: true, }) @@ -42,7 +50,7 @@ export const kusama = defineChain({ name: 'kusama', endpoint: 'wss://rpc.ibp.network/kusama', custom: custom.kusama, - initStorages: getInitStorages(), + initStorages: getInitStorages(custom.kusama), isRelayChain: true, }) @@ -50,6 +58,6 @@ export const westend = defineChain({ name: 'westend', endpoint: 'wss://rpc.ibp.network/westend', custom: custom.westend, - initStorages: getInitStorages(), + initStorages: getInitStorages(custom.westend), isRelayChain: true, }) diff --git a/packages/shared/src/upgrade.ts b/packages/shared/src/upgrade.ts index 001207312..bf3102527 100644 --- a/packages/shared/src/upgrade.ts +++ b/packages/shared/src/upgrade.ts @@ -103,7 +103,7 @@ export async function authorizeUpgradeViaCollectives( await checkEvents(noteEvents, 'preimage').toMatchSnapshot('events after notePreimge') // try to dispatch a call that has not yet been whitelisted - should result in dispatching error - await scheduleInlineCallWithOrigin(governingChain, whiteListCall.method.toHex(), okOrigin) + await scheduleInlineCallWithOrigin(governingChain, whiteListCall.method.toHex(), okOrigin, 'SysPara') await governingChain.dev.newBlock() await checkSystemEvents(governingChain, 'scheduler') .redact({ hash: false, redactKeys: /task/ }) @@ -116,7 +116,7 @@ export async function authorizeUpgradeViaCollectives( refTime: '500000000', }) await collectivesChain.dev.newBlock() - await checkSystemEvents(collectivesChain, 'polkadotXcm') + await checkSystemEvents(collectivesChain, { method: 'Sent', section: 'polkadotXcm' }) .redact({ hash: false, redactKeys: /messageId/ }) .toMatchSnapshot('collectives events emitted when sending xcm') await governingChain.dev.newBlock() @@ -125,7 +125,7 @@ export async function authorizeUpgradeViaCollectives( .toMatchSnapshot('governing chain events emitted on receiving xcm from collectives') // trying to dispatch whitelisted call using bad origin - should result in error - await scheduleInlineCallWithOrigin(governingChain, whiteListCall.method.toHex(), badOrigin) + await scheduleInlineCallWithOrigin(governingChain, whiteListCall.method.toHex(), badOrigin, 'SysPara') await governingChain.dev.newBlock() await checkSystemEvents(governingChain, 'scheduler') .redact({ hash: false, redactKeys: /task/ }) @@ -133,7 +133,7 @@ export async function authorizeUpgradeViaCollectives( await assertAuthorizedUpgradeUnchanged() // call is whitelisted, origin is ok - success expected - await scheduleInlineCallWithOrigin(governingChain, whiteListCall.method.toHex(), okOrigin) + await scheduleInlineCallWithOrigin(governingChain, whiteListCall.method.toHex(), okOrigin, 'SysPara') await governingChain.dev.newBlock() await checkSystemEvents(governingChain, 'whitelist') .redact({ hash: false }) diff --git a/packages/westend/src/__snapshots__/assetHubWestend.bridgeHubWestend.collectivesWestend.test.ts.snap b/packages/westend/src/__snapshots__/assetHubWestend.bridgeHubWestend.collectivesWestend.test.ts.snap new file mode 100644 index 000000000..7ebdb29d4 --- /dev/null +++ b/packages/westend/src/__snapshots__/assetHubWestend.bridgeHubWestend.collectivesWestend.test.ts.snap @@ -0,0 +1,181 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`assetHubWestend & bridgeHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > collectives events emitted when sending xcm 1`] = ` +[ + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": 1000, + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "UnpaidExecution": { + "checkOrigin": null, + "weightLimit": "Unlimited", + }, + }, + { + "Transact": { + "call": { + "encoded": "0x5d005fe91fd0226f96aa51381426e85ce9b72a0e49eefb8bf04e1ae4cf928dd186fd", + }, + "fallbackMaxWeight": { + "proofSize": 10000, + "refTime": 500000000, + }, + "originKind": "Xcm", + }, + }, + ], + "messageId": "(redacted)", + "origin": { + "interior": { + "X1": [ + { + "Plurality": { + "id": "Technical", + "part": "Voice", + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; + +exports[`assetHubWestend & bridgeHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > events after notePreimge 1`] = ` +[ + { + "data": { + "hash_": "(hash)", + }, + "method": "Noted", + "section": "preimage", + }, +] +`; + +exports[`assetHubWestend & bridgeHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > events when dispatching non-whitelisted call 1`] = ` +[ + { + "data": { + "id": null, + "result": { + "Err": { + "Module": { + "error": "0x03000000", + "index": 93, + }, + }, + }, + "task": "(redacted)", + }, + "method": "Dispatched", + "section": "scheduler", + }, +] +`; + +exports[`assetHubWestend & bridgeHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > events when dispatching whitelisted call with bad origin 1`] = ` +[ + { + "data": { + "id": null, + "result": { + "Err": "BadOrigin", + }, + "task": "(redacted)", + }, + "method": "Dispatched", + "section": "scheduler", + }, +] +`; + +exports[`assetHubWestend & bridgeHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > governing chain events about dispatching whitelisted call 1`] = ` +[ + { + "data": { + "callHash": "0x5fe91fd0226f96aa51381426e85ce9b72a0e49eefb8bf04e1ae4cf928dd186fd", + "result": { + "Ok": { + "actualWeight": { + "proofSize": "(rounded 3600)", + "refTime": "(rounded 120000000)", + }, + "paysFee": "Yes", + }, + }, + }, + "method": "WhitelistedCallDispatched", + "section": "whitelist", + }, +] +`; + +exports[`assetHubWestend & bridgeHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > governing chain events emitted on receiving xcm from collectives 1`] = ` +[ + { + "data": { + "callHash": "0x5fe91fd0226f96aa51381426e85ce9b72a0e49eefb8bf04e1ae4cf928dd186fd", + }, + "method": "CallWhitelisted", + "section": "whitelist", + }, + { + "data": { + "id": "(redacted)", + "origin": { + "Sibling": "(rounded 1000)", + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 3600)", + "refTime": "(rounded 120000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`assetHubWestend & bridgeHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > to-be-upgraded chain events to confirm authorized upgrade 1`] = ` +[ + { + "data": { + "checkVersion": true, + "codeHash": "0x0101010101010101010101010101010101010101010101010101010101010101", + }, + "method": "UpgradeAuthorized", + "section": "system", + }, + { + "data": { + "id": "(redacted)", + "origin": { + "Sibling": 1000, + }, + "success": true, + "weightUsed": { + "proofSize": 0, + "refTime": "(rounded 130000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; diff --git a/packages/westend/src/__snapshots__/assetHubWestend.bridgeHubWestend.test.ts.snap b/packages/westend/src/__snapshots__/assetHubWestend.bridgeHubWestend.test.ts.snap new file mode 100644 index 000000000..5dfa502b0 --- /dev/null +++ b/packages/westend/src/__snapshots__/assetHubWestend.bridgeHubWestend.test.ts.snap @@ -0,0 +1,373 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`assetHubWestend & bridgeHubWestend > assetHubWestend transfer WND to bridgeHubWestend > balance on from chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 8970000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 1, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & bridgeHubWestend > assetHubWestend transfer WND to bridgeHubWestend > balance on to chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 996000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 0, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & bridgeHubWestend > assetHubWestend transfer WND to bridgeHubWestend > to chain dmp events 1`] = ` +[ + { + "data": { + "id": "(hash)", + "origin": { + "Sibling": 1000, + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 3600)", + "refTime": "(rounded 160000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`assetHubWestend & bridgeHubWestend > assetHubWestend transfer WND to bridgeHubWestend > tx events 1`] = ` +[ + { + "data": { + "outcome": { + "Complete": { + "used": { + "proofSize": "(rounded 3680)", + "refTime": "(rounded 706000000)", + }, + }, + }, + }, + "method": "Attempted", + "section": "polkadotXcm", + }, + { + "data": { + "fees": [ + { + "fun": { + "Fungible": "(rounded 31000000000)", + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + "paying": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "FeesPaid", + "section": "polkadotXcm", + }, + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": "(rounded 1000)", + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "ReceiveTeleportedAsset": [ + { + "fun": { + "Fungible": 1000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + }, + "ClearOrigin", + { + "BuyExecution": { + "fees": { + "fun": { + "Fungible": 1000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + "weightLimit": "Unlimited", + }, + }, + { + "DepositAsset": { + "assets": { + "Wild": { + "AllCounted": 1, + }, + }, + "beneficiary": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": null, + }, + }, + ], + }, + "parents": 0, + }, + }, + }, + ], + "messageId": "(hash)", + "origin": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; + +exports[`assetHubWestend & bridgeHubWestend > bridgeHubWestend transfer WND to assetHubWestend > balance on from chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 8970000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 1, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & bridgeHubWestend > bridgeHubWestend transfer WND to assetHubWestend > balance on to chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 993000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 0, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & bridgeHubWestend > bridgeHubWestend transfer WND to assetHubWestend > from chain ump messages 1`] = `[]`; + +exports[`assetHubWestend & bridgeHubWestend > bridgeHubWestend transfer WND to assetHubWestend > to chain ump events 1`] = ` +[ + { + "data": { + "id": "(hash)", + "origin": { + "Sibling": "(rounded 1000)", + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 7300)", + "refTime": "(rounded 550000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`assetHubWestend & bridgeHubWestend > bridgeHubWestend transfer WND to assetHubWestend > tx events 1`] = ` +[ + { + "data": { + "outcome": { + "Complete": { + "used": { + "proofSize": "(rounded 3590)", + "refTime": "(rounded 159000000)", + }, + }, + }, + }, + "method": "Attempted", + "section": "polkadotXcm", + }, + { + "data": { + "fees": [ + { + "fun": { + "Fungible": "(rounded 31000000000)", + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + "paying": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "FeesPaid", + "section": "polkadotXcm", + }, + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": 1000, + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "ReceiveTeleportedAsset": [ + { + "fun": { + "Fungible": 1000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + }, + "ClearOrigin", + { + "BuyExecution": { + "fees": { + "fun": { + "Fungible": 1000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + "weightLimit": "Unlimited", + }, + }, + { + "DepositAsset": { + "assets": { + "Wild": { + "AllCounted": 1, + }, + }, + "beneficiary": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": null, + }, + }, + ], + }, + "parents": 0, + }, + }, + }, + ], + "messageId": "(hash)", + "origin": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; diff --git a/packages/westend/src/__snapshots__/assetHubWestend.collectivesWestend.test.ts.snap b/packages/westend/src/__snapshots__/assetHubWestend.collectivesWestend.test.ts.snap new file mode 100644 index 000000000..7eefb2c20 --- /dev/null +++ b/packages/westend/src/__snapshots__/assetHubWestend.collectivesWestend.test.ts.snap @@ -0,0 +1,617 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`assetHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > collectives events emitted when sending xcm 1`] = ` +[ + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": 1000, + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "UnpaidExecution": { + "checkOrigin": null, + "weightLimit": "Unlimited", + }, + }, + { + "Transact": { + "call": { + "encoded": "0x5d003812e839c2f2db66069c9ee359bbc78e7ec08cb657d0a735742e68c5c0668a84", + }, + "fallbackMaxWeight": { + "proofSize": 10000, + "refTime": 500000000, + }, + "originKind": "Xcm", + }, + }, + ], + "messageId": "(redacted)", + "origin": { + "interior": { + "X1": [ + { + "Plurality": { + "id": "Technical", + "part": "Voice", + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; + +exports[`assetHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > events after notePreimge 1`] = ` +[ + { + "data": { + "hash_": "(hash)", + }, + "method": "Noted", + "section": "preimage", + }, +] +`; + +exports[`assetHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > events when dispatching non-whitelisted call 1`] = ` +[ + { + "data": { + "id": null, + "result": { + "Err": { + "Module": { + "error": "0x03000000", + "index": 93, + }, + }, + }, + "task": "(redacted)", + }, + "method": "Dispatched", + "section": "scheduler", + }, +] +`; + +exports[`assetHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > events when dispatching whitelisted call with bad origin 1`] = ` +[ + { + "data": { + "id": null, + "result": { + "Err": "BadOrigin", + }, + "task": "(redacted)", + }, + "method": "Dispatched", + "section": "scheduler", + }, +] +`; + +exports[`assetHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > governing chain events about dispatching whitelisted call 1`] = ` +[ + { + "data": { + "callHash": "0x3812e839c2f2db66069c9ee359bbc78e7ec08cb657d0a735742e68c5c0668a84", + "result": { + "Ok": { + "actualWeight": null, + "paysFee": "Yes", + }, + }, + }, + "method": "WhitelistedCallDispatched", + "section": "whitelist", + }, +] +`; + +exports[`assetHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > governing chain events emitted on receiving xcm from collectives 1`] = ` +[ + { + "data": { + "callHash": "0x3812e839c2f2db66069c9ee359bbc78e7ec08cb657d0a735742e68c5c0668a84", + }, + "method": "CallWhitelisted", + "section": "whitelist", + }, + { + "data": { + "id": "(redacted)", + "origin": { + "Sibling": "(rounded 1000)", + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 3600)", + "refTime": "(rounded 280000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`assetHubWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > to-be-upgraded chain events to confirm authorized upgrade 1`] = ` +[ + { + "data": { + "checkVersion": true, + "codeHash": "0x0101010101010101010101010101010101010101010101010101010101010101", + }, + "method": "UpgradeAuthorized", + "section": "system", + }, +] +`; + +exports[`assetHubWestend & collectivesWestend > assetHubWestend transfer WND to collectivesWestend > balance on from chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 8970000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 1, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & collectivesWestend > assetHubWestend transfer WND to collectivesWestend > balance on to chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 996000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 0, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & collectivesWestend > assetHubWestend transfer WND to collectivesWestend > to chain dmp events 1`] = ` +[ + { + "data": { + "id": "(hash)", + "origin": { + "Sibling": 1000, + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 3600)", + "refTime": "(rounded 150000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`assetHubWestend & collectivesWestend > assetHubWestend transfer WND to collectivesWestend > tx events 1`] = ` +[ + { + "data": { + "outcome": { + "Complete": { + "used": { + "proofSize": "(rounded 3680)", + "refTime": "(rounded 706000000)", + }, + }, + }, + }, + "method": "Attempted", + "section": "polkadotXcm", + }, + { + "data": { + "fees": [ + { + "fun": { + "Fungible": "(rounded 31000000000)", + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + "paying": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "FeesPaid", + "section": "polkadotXcm", + }, + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": "(rounded 1000)", + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "ReceiveTeleportedAsset": [ + { + "fun": { + "Fungible": 1000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + }, + "ClearOrigin", + { + "BuyExecution": { + "fees": { + "fun": { + "Fungible": 1000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + "weightLimit": "Unlimited", + }, + }, + { + "DepositAsset": { + "assets": { + "Wild": { + "AllCounted": 1, + }, + }, + "beneficiary": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": null, + }, + }, + ], + }, + "parents": 0, + }, + }, + }, + ], + "messageId": "(hash)", + "origin": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; + +exports[`assetHubWestend & collectivesWestend > collectivesWestend transfer WND to assetHubWestend > balance on from chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 8970000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 1, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & collectivesWestend > collectivesWestend transfer WND to assetHubWestend > balance on to chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 993000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 0, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & collectivesWestend > collectivesWestend transfer WND to assetHubWestend > from chain ump messages 1`] = `[]`; + +exports[`assetHubWestend & collectivesWestend > collectivesWestend transfer WND to assetHubWestend > to chain ump events 1`] = ` +[ + { + "data": { + "id": "(hash)", + "origin": { + "Sibling": "(rounded 1000)", + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 7300)", + "refTime": "(rounded 550000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`assetHubWestend & collectivesWestend > collectivesWestend transfer WND to assetHubWestend > tx events 1`] = ` +[ + { + "data": { + "outcome": { + "Complete": { + "used": { + "proofSize": "(rounded 3590)", + "refTime": "(rounded 160000000)", + }, + }, + }, + }, + "method": "Attempted", + "section": "polkadotXcm", + }, + { + "data": { + "fees": [ + { + "fun": { + "Fungible": "(rounded 31000000000)", + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + "paying": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "FeesPaid", + "section": "polkadotXcm", + }, + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": 1000, + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "ReceiveTeleportedAsset": [ + { + "fun": { + "Fungible": 1000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + }, + "ClearOrigin", + { + "BuyExecution": { + "fees": { + "fun": { + "Fungible": 1000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + "weightLimit": "Unlimited", + }, + }, + { + "DepositAsset": { + "assets": { + "Wild": { + "AllCounted": 1, + }, + }, + "beneficiary": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": null, + }, + }, + ], + }, + "parents": 0, + }, + }, + }, + ], + "messageId": "(hash)", + "origin": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; + +exports[`collectives westend & asset hub westend > whitelisting a call by fellowship > destination chain events 1`] = ` +[ + { + "data": { + "callHash": "0x0101010101010101010101010101010101010101010101010101010101010101", + }, + "method": "CallWhitelisted", + "section": "whitelist", + }, + { + "data": { + "id": "(redacted)", + "origin": { + "Sibling": "(rounded 1000)", + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 3600)", + "refTime": "(rounded 280000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`collectives westend & asset hub westend > whitelisting a call by fellowship > source chain events 1`] = ` +[ + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": 1000, + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "UnpaidExecution": { + "checkOrigin": null, + "weightLimit": "Unlimited", + }, + }, + { + "Transact": { + "call": { + "encoded": "0x5d000101010101010101010101010101010101010101010101010101010101010101", + }, + "fallbackMaxWeight": { + "proofSize": 10000, + "refTime": 1000000000, + }, + "originKind": "Xcm", + }, + }, + ], + "messageId": "(redacted)", + "origin": { + "interior": { + "X1": [ + { + "Plurality": { + "id": "Technical", + "part": "Voice", + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; diff --git a/packages/westend/src/__snapshots__/assetHubWestend.coretimeWestend.collectivesWestend.test.ts.snap b/packages/westend/src/__snapshots__/assetHubWestend.coretimeWestend.collectivesWestend.test.ts.snap new file mode 100644 index 000000000..e4e68a7ad --- /dev/null +++ b/packages/westend/src/__snapshots__/assetHubWestend.coretimeWestend.collectivesWestend.test.ts.snap @@ -0,0 +1,181 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`assetHubWestend & coretimeWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > collectives events emitted when sending xcm 1`] = ` +[ + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": 1000, + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "UnpaidExecution": { + "checkOrigin": null, + "weightLimit": "Unlimited", + }, + }, + { + "Transact": { + "call": { + "encoded": "0x5d0020883d25f1db1e4a6789b18726a0e94c8a8824c7f329d010633c5d8ad9a1a730", + }, + "fallbackMaxWeight": { + "proofSize": 10000, + "refTime": 500000000, + }, + "originKind": "Xcm", + }, + }, + ], + "messageId": "(redacted)", + "origin": { + "interior": { + "X1": [ + { + "Plurality": { + "id": "Technical", + "part": "Voice", + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; + +exports[`assetHubWestend & coretimeWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > events after notePreimge 1`] = ` +[ + { + "data": { + "hash_": "(hash)", + }, + "method": "Noted", + "section": "preimage", + }, +] +`; + +exports[`assetHubWestend & coretimeWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > events when dispatching non-whitelisted call 1`] = ` +[ + { + "data": { + "id": null, + "result": { + "Err": { + "Module": { + "error": "0x03000000", + "index": 93, + }, + }, + }, + "task": "(redacted)", + }, + "method": "Dispatched", + "section": "scheduler", + }, +] +`; + +exports[`assetHubWestend & coretimeWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > events when dispatching whitelisted call with bad origin 1`] = ` +[ + { + "data": { + "id": null, + "result": { + "Err": "BadOrigin", + }, + "task": "(redacted)", + }, + "method": "Dispatched", + "section": "scheduler", + }, +] +`; + +exports[`assetHubWestend & coretimeWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > governing chain events about dispatching whitelisted call 1`] = ` +[ + { + "data": { + "callHash": "0x20883d25f1db1e4a6789b18726a0e94c8a8824c7f329d010633c5d8ad9a1a730", + "result": { + "Ok": { + "actualWeight": { + "proofSize": "(rounded 3600)", + "refTime": "(rounded 120000000)", + }, + "paysFee": "Yes", + }, + }, + }, + "method": "WhitelistedCallDispatched", + "section": "whitelist", + }, +] +`; + +exports[`assetHubWestend & coretimeWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > governing chain events emitted on receiving xcm from collectives 1`] = ` +[ + { + "data": { + "callHash": "0x20883d25f1db1e4a6789b18726a0e94c8a8824c7f329d010633c5d8ad9a1a730", + }, + "method": "CallWhitelisted", + "section": "whitelist", + }, + { + "data": { + "id": "(redacted)", + "origin": { + "Sibling": "(rounded 1000)", + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 3600)", + "refTime": "(rounded 120000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`assetHubWestend & coretimeWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > to-be-upgraded chain events to confirm authorized upgrade 1`] = ` +[ + { + "data": { + "checkVersion": true, + "codeHash": "0x0101010101010101010101010101010101010101010101010101010101010101", + }, + "method": "UpgradeAuthorized", + "section": "system", + }, + { + "data": { + "id": "(redacted)", + "origin": { + "Sibling": 1000, + }, + "success": true, + "weightUsed": { + "proofSize": 0, + "refTime": "(rounded 120000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; diff --git a/packages/westend/src/__snapshots__/assetHubWestend.coretimeWestend.test.ts.snap b/packages/westend/src/__snapshots__/assetHubWestend.coretimeWestend.test.ts.snap new file mode 100644 index 000000000..4fb8c8220 --- /dev/null +++ b/packages/westend/src/__snapshots__/assetHubWestend.coretimeWestend.test.ts.snap @@ -0,0 +1,373 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`assetHubWestend & coretimeWestend > assetHubWestend transfer WND to coretimeWestend > balance on from chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 900000000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 1, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & coretimeWestend > assetHubWestend transfer WND to coretimeWestend > balance on to chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 100000000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 0, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & coretimeWestend > assetHubWestend transfer WND to coretimeWestend > to chain dmp events 1`] = ` +[ + { + "data": { + "id": "(hash)", + "origin": { + "Sibling": 1000, + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 7200)", + "refTime": "(rounded 280000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`assetHubWestend & coretimeWestend > assetHubWestend transfer WND to coretimeWestend > tx events 1`] = ` +[ + { + "data": { + "outcome": { + "Complete": { + "used": { + "proofSize": "(rounded 3680)", + "refTime": "(rounded 303000000)", + }, + }, + }, + }, + "method": "Attempted", + "section": "polkadotXcm", + }, + { + "data": { + "fees": [ + { + "fun": { + "Fungible": "(rounded 31000000000)", + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + "paying": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "FeesPaid", + "section": "polkadotXcm", + }, + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": "(rounded 1010)", + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "ReceiveTeleportedAsset": [ + { + "fun": { + "Fungible": 100000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + }, + "ClearOrigin", + { + "BuyExecution": { + "fees": { + "fun": { + "Fungible": 100000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + "weightLimit": "Unlimited", + }, + }, + { + "DepositAsset": { + "assets": { + "Wild": { + "AllCounted": 1, + }, + }, + "beneficiary": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": null, + }, + }, + ], + }, + "parents": 0, + }, + }, + }, + ], + "messageId": "(hash)", + "origin": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; + +exports[`assetHubWestend & coretimeWestend > coretimeWestend transfer WND to assetHubWestend > balance on from chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 900000000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 1, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & coretimeWestend > coretimeWestend transfer WND to assetHubWestend > balance on to chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 100000000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 0, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & coretimeWestend > coretimeWestend transfer WND to assetHubWestend > from chain ump messages 1`] = `[]`; + +exports[`assetHubWestend & coretimeWestend > coretimeWestend transfer WND to assetHubWestend > to chain ump events 1`] = ` +[ + { + "data": { + "id": "(hash)", + "origin": { + "Sibling": "(rounded 1000)", + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 7300)", + "refTime": "(rounded 220000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`assetHubWestend & coretimeWestend > coretimeWestend transfer WND to assetHubWestend > tx events 1`] = ` +[ + { + "data": { + "outcome": { + "Complete": { + "used": { + "proofSize": "(rounded 3590)", + "refTime": "(rounded 159000000)", + }, + }, + }, + }, + "method": "Attempted", + "section": "polkadotXcm", + }, + { + "data": { + "fees": [ + { + "fun": { + "Fungible": "(rounded 31000000000)", + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + "paying": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "FeesPaid", + "section": "polkadotXcm", + }, + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": 1000, + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "ReceiveTeleportedAsset": [ + { + "fun": { + "Fungible": 100000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + }, + "ClearOrigin", + { + "BuyExecution": { + "fees": { + "fun": { + "Fungible": 100000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + "weightLimit": "Unlimited", + }, + }, + { + "DepositAsset": { + "assets": { + "Wild": { + "AllCounted": 1, + }, + }, + "beneficiary": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": null, + }, + }, + ], + }, + "parents": 0, + }, + }, + }, + ], + "messageId": "(hash)", + "origin": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; diff --git a/packages/westend/src/__snapshots__/assetHubWestend.peopleWestend.collectivesWestend.test.ts.snap b/packages/westend/src/__snapshots__/assetHubWestend.peopleWestend.collectivesWestend.test.ts.snap new file mode 100644 index 000000000..5ac3cc2fe --- /dev/null +++ b/packages/westend/src/__snapshots__/assetHubWestend.peopleWestend.collectivesWestend.test.ts.snap @@ -0,0 +1,181 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`assetHubWestend & peopleWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > collectives events emitted when sending xcm 1`] = ` +[ + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": 1000, + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "UnpaidExecution": { + "checkOrigin": null, + "weightLimit": "Unlimited", + }, + }, + { + "Transact": { + "call": { + "encoded": "0x5d002172908cd3bec3912f6ff6a7b361d2243fdfddb22bd5968103efb21370f28ccf", + }, + "fallbackMaxWeight": { + "proofSize": 10000, + "refTime": 500000000, + }, + "originKind": "Xcm", + }, + }, + ], + "messageId": "(redacted)", + "origin": { + "interior": { + "X1": [ + { + "Plurality": { + "id": "Technical", + "part": "Voice", + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; + +exports[`assetHubWestend & peopleWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > events after notePreimge 1`] = ` +[ + { + "data": { + "hash_": "(hash)", + }, + "method": "Noted", + "section": "preimage", + }, +] +`; + +exports[`assetHubWestend & peopleWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > events when dispatching non-whitelisted call 1`] = ` +[ + { + "data": { + "id": null, + "result": { + "Err": { + "Module": { + "error": "0x03000000", + "index": 93, + }, + }, + }, + "task": "(redacted)", + }, + "method": "Dispatched", + "section": "scheduler", + }, +] +`; + +exports[`assetHubWestend & peopleWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > events when dispatching whitelisted call with bad origin 1`] = ` +[ + { + "data": { + "id": null, + "result": { + "Err": "BadOrigin", + }, + "task": "(redacted)", + }, + "method": "Dispatched", + "section": "scheduler", + }, +] +`; + +exports[`assetHubWestend & peopleWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > governing chain events about dispatching whitelisted call 1`] = ` +[ + { + "data": { + "callHash": "0x2172908cd3bec3912f6ff6a7b361d2243fdfddb22bd5968103efb21370f28ccf", + "result": { + "Ok": { + "actualWeight": { + "proofSize": "(rounded 3600)", + "refTime": "(rounded 120000000)", + }, + "paysFee": "Yes", + }, + }, + }, + "method": "WhitelistedCallDispatched", + "section": "whitelist", + }, +] +`; + +exports[`assetHubWestend & peopleWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > governing chain events emitted on receiving xcm from collectives 1`] = ` +[ + { + "data": { + "callHash": "0x2172908cd3bec3912f6ff6a7b361d2243fdfddb22bd5968103efb21370f28ccf", + }, + "method": "CallWhitelisted", + "section": "whitelist", + }, + { + "data": { + "id": "(redacted)", + "origin": { + "Sibling": "(rounded 1000)", + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 3600)", + "refTime": "(rounded 120000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`assetHubWestend & peopleWestend & collectivesWestend > Asset Hub authorizes People upgrade via Collectives > to-be-upgraded chain events to confirm authorized upgrade 1`] = ` +[ + { + "data": { + "checkVersion": true, + "codeHash": "0x0101010101010101010101010101010101010101010101010101010101010101", + }, + "method": "UpgradeAuthorized", + "section": "system", + }, + { + "data": { + "id": "(redacted)", + "origin": { + "Sibling": 1000, + }, + "success": true, + "weightUsed": { + "proofSize": 0, + "refTime": "(rounded 120000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; diff --git a/packages/westend/src/__snapshots__/assetHubWestend.peopleWestend.test.ts.snap b/packages/westend/src/__snapshots__/assetHubWestend.peopleWestend.test.ts.snap new file mode 100644 index 000000000..795b8aa67 --- /dev/null +++ b/packages/westend/src/__snapshots__/assetHubWestend.peopleWestend.test.ts.snap @@ -0,0 +1,373 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`assetHubWestend & peopleWestend > assetHubWestend transfer WND to peopleWestend > balance on from chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 900000000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 1, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & peopleWestend > assetHubWestend transfer WND to peopleWestend > balance on to chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 100000000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 0, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & peopleWestend > assetHubWestend transfer WND to peopleWestend > to chain dmp events 1`] = ` +[ + { + "data": { + "id": "(hash)", + "origin": { + "Sibling": 1000, + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 7200)", + "refTime": "(rounded 280000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`assetHubWestend & peopleWestend > assetHubWestend transfer WND to peopleWestend > tx events 1`] = ` +[ + { + "data": { + "outcome": { + "Complete": { + "used": { + "proofSize": "(rounded 3680)", + "refTime": "(rounded 706000000)", + }, + }, + }, + }, + "method": "Attempted", + "section": "polkadotXcm", + }, + { + "data": { + "fees": [ + { + "fun": { + "Fungible": "(rounded 31000000000)", + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + "paying": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "FeesPaid", + "section": "polkadotXcm", + }, + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": "(rounded 1000)", + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "ReceiveTeleportedAsset": [ + { + "fun": { + "Fungible": 100000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + }, + "ClearOrigin", + { + "BuyExecution": { + "fees": { + "fun": { + "Fungible": 100000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + "weightLimit": "Unlimited", + }, + }, + { + "DepositAsset": { + "assets": { + "Wild": { + "AllCounted": 1, + }, + }, + "beneficiary": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": null, + }, + }, + ], + }, + "parents": 0, + }, + }, + }, + ], + "messageId": "(hash)", + "origin": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; + +exports[`assetHubWestend & peopleWestend > peopleWestend transfer WND to assetHubWestend > balance on from chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 900000000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 1, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & peopleWestend > peopleWestend transfer WND to assetHubWestend > balance on to chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 100000000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 0, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`assetHubWestend & peopleWestend > peopleWestend transfer WND to assetHubWestend > from chain ump messages 1`] = `[]`; + +exports[`assetHubWestend & peopleWestend > peopleWestend transfer WND to assetHubWestend > to chain ump events 1`] = ` +[ + { + "data": { + "id": "(hash)", + "origin": { + "Sibling": "(rounded 1000)", + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 7300)", + "refTime": "(rounded 550000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`assetHubWestend & peopleWestend > peopleWestend transfer WND to assetHubWestend > tx events 1`] = ` +[ + { + "data": { + "outcome": { + "Complete": { + "used": { + "proofSize": "(rounded 3590)", + "refTime": "(rounded 159000000)", + }, + }, + }, + }, + "method": "Attempted", + "section": "polkadotXcm", + }, + { + "data": { + "fees": [ + { + "fun": { + "Fungible": "(rounded 31000000000)", + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + "paying": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "FeesPaid", + "section": "polkadotXcm", + }, + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": 1000, + }, + ], + }, + "parents": 1, + }, + "message": [ + { + "ReceiveTeleportedAsset": [ + { + "fun": { + "Fungible": 100000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + ], + }, + "ClearOrigin", + { + "BuyExecution": { + "fees": { + "fun": { + "Fungible": 100000000000000, + }, + "id": { + "interior": "Here", + "parents": 1, + }, + }, + "weightLimit": "Unlimited", + }, + }, + { + "DepositAsset": { + "assets": { + "Wild": { + "AllCounted": 1, + }, + }, + "beneficiary": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": null, + }, + }, + ], + }, + "parents": 0, + }, + }, + }, + ], + "messageId": "(hash)", + "origin": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, +] +`; diff --git a/packages/westend/src/__snapshots__/assetHubWestend.westend.test.ts.snap b/packages/westend/src/__snapshots__/assetHubWestend.westend.test.ts.snap new file mode 100644 index 000000000..9dface280 --- /dev/null +++ b/packages/westend/src/__snapshots__/assetHubWestend.westend.test.ts.snap @@ -0,0 +1,287 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`asset hub westend & westend > Teleport WND from Asset Hub Westend to Westend > balance on from chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 900000000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 1, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`asset hub westend & westend > Teleport WND from Asset Hub Westend to Westend > balance on to chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": 0, + "frozen": 0, + "reserved": 0, + }, + "nonce": 0, + "providers": 0, + "sufficients": 0, +} +`; + +exports[`asset hub westend & westend > Teleport WND from Asset Hub Westend to Westend > from chain ump messages 1`] = ` +[ + { + "v5": [ + { + "receiveTeleportedAsset": [ + { + "fun": { + "fungible": 100000000000000, + }, + "id": { + "interior": { + "here": null, + }, + "parents": 0, + }, + }, + ], + }, + { + "clearOrigin": null, + }, + { + "buyExecution": { + "fees": { + "fun": { + "fungible": 500000000000, + }, + "id": { + "interior": { + "here": null, + }, + "parents": 0, + }, + }, + "weightLimit": { + "unlimited": null, + }, + }, + }, + { + "depositAsset": { + "assets": { + "wild": { + "allCounted": 1, + }, + }, + "beneficiary": { + "interior": { + "x1": [ + { + "accountId32": { + "id": "0x5e639b43e0052c47447dac87d6fd2b6ec50bdd4d0f614e4299c665249bbd09d9", + "network": null, + }, + }, + ], + }, + "parents": 0, + }, + }, + }, + { + "setTopic": "(redacted)", + }, + ], + }, +] +`; + +exports[`asset hub westend & westend > Teleport WND from Asset Hub Westend to Westend > to chain ump events 1`] = ` +[ + { + "data": { + "id": "(hash)", + "origin": { + "Ump": { + "Para": 1000, + }, + }, + "success": true, + "weightUsed": { + "proofSize": "(rounded 7200)", + "refTime": "(rounded 320000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`asset hub westend & westend > Teleport WND from Asset Hub Westend to Westend > tx events 1`] = ` +[ + { + "data": { + "destination": { + "interior": "Here", + "parents": 1, + }, + "message": [], + "messageId": "(hash)", + "origin": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "polkadotXcm", + }, + { + "data": { + "outcome": { + "Complete": { + "used": { + "proofSize": "(rounded 393000)", + "refTime": "(rounded 16800000000)", + }, + }, + }, + }, + "method": "Attempted", + "section": "polkadotXcm", + }, +] +`; + +exports[`asset hub westend & westend > Teleport WND from Westend to Asset Hub > balance on from chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 900000000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 1, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`asset hub westend & westend > Teleport WND from Westend to Asset Hub > balance on to chain 1`] = ` +{ + "consumers": 0, + "data": { + "flags": "0x80000000000000000000000000000000", + "free": "(rounded 843000000000)", + "frozen": 0, + "reserved": 0, + }, + "nonce": 0, + "providers": 1, + "sufficients": 0, +} +`; + +exports[`asset hub westend & westend > Teleport WND from Westend to Asset Hub > to chain dmp events 1`] = ` +[ + { + "data": { + "count": 1, + }, + "method": "DownwardMessagesReceived", + "section": "parachainSystem", + }, + { + "data": { + "dmqHead": "(hash)", + "weightUsed": { + "proofSize": "(rounded 3500)", + "refTime": "(rounded 550000000)", + }, + }, + "method": "DownwardMessagesProcessed", + "section": "parachainSystem", + }, + { + "data": { + "id": "(hash)", + "origin": "Parent", + "success": true, + "weightUsed": { + "proofSize": "(rounded 7300)", + "refTime": "(rounded 220000000)", + }, + }, + "method": "Processed", + "section": "messageQueue", + }, +] +`; + +exports[`asset hub westend & westend > Teleport WND from Westend to Asset Hub > tx events 1`] = ` +[ + { + "data": { + "destination": { + "interior": { + "X1": [ + { + "Parachain": 1000, + }, + ], + }, + "parents": 0, + }, + "message": [], + "messageId": "(hash)", + "origin": { + "interior": { + "X1": [ + { + "AccountId32": { + "id": "(hash)", + "network": { + "ByGenesis": "(hash)", + }, + }, + }, + ], + }, + "parents": 0, + }, + }, + "method": "Sent", + "section": "xcmPallet", + }, + { + "data": { + "outcome": { + "Complete": { + "used": { + "proofSize": 7270, + "refTime": "(rounded 692000000)", + }, + }, + }, + }, + "method": "Attempted", + "section": "xcmPallet", + }, +] +`; diff --git a/packages/westend/src/__snapshots__/collectivesWestend.assetHubWestend.test.ts.snap b/packages/westend/src/__snapshots__/collectivesWestend.assetHubWestend.test.ts.snap deleted file mode 100644 index 75d0571cb..000000000 --- a/packages/westend/src/__snapshots__/collectivesWestend.assetHubWestend.test.ts.snap +++ /dev/null @@ -1,83 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`collectives westend & asset hub westend > whitelisting a call by fellowship > destination chain events 1`] = ` -[ - { - "data": { - "callHash": "0x0101010101010101010101010101010101010101010101010101010101010101", - }, - "method": "CallWhitelisted", - "section": "whitelist", - }, - { - "data": { - "id": "(redacted)", - "origin": { - "Sibling": "(rounded 1000)", - }, - "success": true, - "weightUsed": { - "proofSize": "(rounded 3600)", - "refTime": "(rounded 280000000)", - }, - }, - "method": "Processed", - "section": "messageQueue", - }, -] -`; - -exports[`collectives westend & asset hub westend > whitelisting a call by fellowship > source chain events 1`] = ` -[ - { - "data": { - "destination": { - "interior": { - "X1": [ - { - "Parachain": 1000, - }, - ], - }, - "parents": 1, - }, - "message": [ - { - "UnpaidExecution": { - "checkOrigin": null, - "weightLimit": "Unlimited", - }, - }, - { - "Transact": { - "call": { - "encoded": "0x5d000101010101010101010101010101010101010101010101010101010101010101", - }, - "fallbackMaxWeight": { - "proofSize": 10000, - "refTime": 1000000000, - }, - "originKind": "Xcm", - }, - }, - ], - "messageId": "(redacted)", - "origin": { - "interior": { - "X1": [ - { - "Plurality": { - "id": "Technical", - "part": "Voice", - }, - }, - ], - }, - "parents": 0, - }, - }, - "method": "Sent", - "section": "polkadotXcm", - }, -] -`; diff --git a/packages/westend/src/assetHubWestend.bridgeHubWestend.collectivesWestend.test.ts b/packages/westend/src/assetHubWestend.bridgeHubWestend.collectivesWestend.test.ts new file mode 100644 index 000000000..778a5e91f --- /dev/null +++ b/packages/westend/src/assetHubWestend.bridgeHubWestend.collectivesWestend.test.ts @@ -0,0 +1,17 @@ +import { describe, test } from 'vitest' + +import { assetHubWestend, bridgeHubWestend, collectivesWestend } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' +import { authorizeUpgradeViaCollectives } from '@e2e-test/shared/upgrade.js' + +describe('assetHubWestend & bridgeHubWestend & collectivesWestend', async () => { + const [ahClient, bridgeHubClient, collectivesClient] = await setupNetworks( + assetHubWestend, + bridgeHubWestend, + collectivesWestend, + ) + + test('Asset Hub authorizes People upgrade via Collectives', async () => { + await authorizeUpgradeViaCollectives(ahClient, bridgeHubClient, collectivesClient) + }) +}) diff --git a/packages/westend/src/assetHubWestend.bridgeHubWestend.test.ts b/packages/westend/src/assetHubWestend.bridgeHubWestend.test.ts new file mode 100644 index 000000000..77e0fdc6e --- /dev/null +++ b/packages/westend/src/assetHubWestend.bridgeHubWestend.test.ts @@ -0,0 +1,38 @@ +import { describe } from 'vitest' + +import { defaultAccounts } from '@e2e-test/networks' +import { assetHubWestend, bridgeHubWestend } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' +import { query, tx } from '@e2e-test/shared/api' +import { runXcmPalletDown, runXcmPalletUp } from '@e2e-test/shared/xcm' + +describe('assetHubWestend & bridgeHubWestend', async () => { + const [assetHubWestendClient, bridgeHubClient] = await setupNetworks(assetHubWestend, bridgeHubWestend) + + const bridgeHubWND = bridgeHubWestend.custom.wnd + const westendWND = assetHubWestend.custom.wnd + + runXcmPalletDown('assetHubWestend transfer WND to bridgeHubWestend', async () => { + return { + fromChain: assetHubWestendClient, + toChain: bridgeHubClient, + balance: query.balances, + toAccount: defaultAccounts.dave, + tx: tx.xcmPallet.limitedTeleportAssets(westendWND, 1e12, tx.xcmPallet.parachainV3(1, bridgeHubWestend.paraId!)), + } + }) + + runXcmPalletUp('bridgeHubWestend transfer WND to assetHubWestend', async () => { + return { + fromChain: bridgeHubClient, + toChain: assetHubWestendClient, + balance: query.balances, + toAccount: defaultAccounts.dave, + tx: tx.xcmPallet.limitedTeleportAssets( + bridgeHubWND, + 1e12, + tx.xcmPallet.parachainV3(1, assetHubWestendClient.config.paraId!), + ), + } + }) +}) diff --git a/packages/westend/src/assetHubWestend.collectivesWestend.test.ts b/packages/westend/src/assetHubWestend.collectivesWestend.test.ts new file mode 100644 index 000000000..c7a5ad004 --- /dev/null +++ b/packages/westend/src/assetHubWestend.collectivesWestend.test.ts @@ -0,0 +1,47 @@ +import { defaultAccounts } from '@e2e-test/networks' +import { assetHubWestend, collectivesWestend } from '@e2e-test/networks/chains' +import { collectivesChainE2ETests } from '@e2e-test/shared' +import { setupNetworks } from '@e2e-test/shared' +import { query, tx } from '@e2e-test/shared/api' +import { authorizeUpgradeViaCollectives } from '@e2e-test/shared/upgrade.js' +import { runXcmPalletDown, runXcmPalletUp } from '@e2e-test/shared/xcm' +import { describe, test } from 'vitest' + +collectivesChainE2ETests(assetHubWestend, collectivesWestend, { + testSuiteName: 'collectives westend & asset hub westend', +}) + +describe('assetHubWestend & collectivesWestend', async () => { + const [assetHubWestendClient, collectivesClient] = await setupNetworks(assetHubWestend, collectivesWestend) + + const collectivesWND = collectivesWestend.custom.wnd + const westendWND = assetHubWestend.custom.wnd + + runXcmPalletDown('assetHubWestend transfer WND to collectivesWestend', async () => { + return { + fromChain: assetHubWestendClient, + toChain: collectivesClient, + balance: query.balances, + toAccount: defaultAccounts.dave, + tx: tx.xcmPallet.limitedTeleportAssets(westendWND, 1e12, tx.xcmPallet.parachainV3(1, collectivesWestend.paraId!)), + } + }) + + runXcmPalletUp('collectivesWestend transfer WND to assetHubWestend', async () => { + return { + fromChain: collectivesClient, + toChain: assetHubWestendClient, + balance: query.balances, + toAccount: defaultAccounts.dave, + tx: tx.xcmPallet.limitedTeleportAssets( + collectivesWND, + 1e12, + tx.xcmPallet.parachainV3(1, assetHubWestendClient.config.paraId!), + ), + } + }) + + test('Asset Hub authorizes People upgrade via Collectives', async () => { + await authorizeUpgradeViaCollectives(assetHubWestendClient, assetHubWestendClient, collectivesClient) + }) +}) diff --git a/packages/westend/src/assetHubWestend.coretimeWestend.collectivesWestend.test.ts b/packages/westend/src/assetHubWestend.coretimeWestend.collectivesWestend.test.ts new file mode 100644 index 000000000..303e97ff5 --- /dev/null +++ b/packages/westend/src/assetHubWestend.coretimeWestend.collectivesWestend.test.ts @@ -0,0 +1,17 @@ +import { describe, test } from 'vitest' + +import { assetHubWestend, collectivesWestend, coretimeWestend } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' +import { authorizeUpgradeViaCollectives } from '@e2e-test/shared/upgrade.js' + +describe('assetHubWestend & coretimeWestend & collectivesWestend', async () => { + const [ahClient, cortetimeClient, collectivesClient] = await setupNetworks( + assetHubWestend, + coretimeWestend, + collectivesWestend, + ) + + test('Asset Hub authorizes People upgrade via Collectives', async () => { + await authorizeUpgradeViaCollectives(ahClient, cortetimeClient, collectivesClient) + }) +}) diff --git a/packages/westend/src/assetHubWestend.coretimeWestend.test.ts b/packages/westend/src/assetHubWestend.coretimeWestend.test.ts new file mode 100644 index 000000000..7083455b1 --- /dev/null +++ b/packages/westend/src/assetHubWestend.coretimeWestend.test.ts @@ -0,0 +1,42 @@ +import { describe } from 'vitest' + +import { defaultAccounts } from '@e2e-test/networks' +import { assetHubWestend, coretimeWestend } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' +import { query, tx } from '@e2e-test/shared/api' +import { runXcmPalletDown, runXcmPalletUp } from '@e2e-test/shared/xcm' + +describe('assetHubWestend & coretimeWestend', async () => { + const [assetHubWestendClient, coretimeClient] = await setupNetworks(assetHubWestend, coretimeWestend) + + const coretimeWND = coretimeWestend.custom.wnd + const westendWND = assetHubWestend.custom.wnd + + runXcmPalletDown('assetHubWestend transfer WND to coretimeWestend', async () => { + return { + fromChain: assetHubWestendClient, + toChain: coretimeClient, + balance: query.balances, + toAccount: defaultAccounts.dave, + tx: tx.xcmPallet.limitedTeleportAssets( + westendWND, + 100 * assetHubWestend.custom.units, + tx.xcmPallet.parachainV3(1, coretimeWestend.paraId!), + ), + } + }) + + runXcmPalletUp('coretimeWestend transfer WND to assetHubWestend', async () => { + return { + fromChain: coretimeClient, + toChain: assetHubWestendClient, + balance: query.balances, + toAccount: defaultAccounts.dave, + tx: tx.xcmPallet.limitedTeleportAssets( + coretimeWND, + 100 * coretimeWestend.custom.units, + tx.xcmPallet.parachainV3(1, assetHubWestendClient.config.paraId!), + ), + } + }) +}) diff --git a/packages/westend/src/assetHubWestend.peopleWestend.collectivesWestend.test.ts b/packages/westend/src/assetHubWestend.peopleWestend.collectivesWestend.test.ts new file mode 100644 index 000000000..a963faa10 --- /dev/null +++ b/packages/westend/src/assetHubWestend.peopleWestend.collectivesWestend.test.ts @@ -0,0 +1,17 @@ +import { describe, test } from 'vitest' + +import { assetHubWestend, collectivesWestend, peopleWestend } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' +import { authorizeUpgradeViaCollectives } from '@e2e-test/shared/upgrade.js' + +describe('assetHubWestend & peopleWestend & collectivesWestend', async () => { + const [ahClient, peopleClient, collectivesClient] = await setupNetworks( + assetHubWestend, + peopleWestend, + collectivesWestend, + ) + + test('Asset Hub authorizes People upgrade via Collectives', async () => { + await authorizeUpgradeViaCollectives(ahClient, peopleClient, collectivesClient) + }) +}) diff --git a/packages/westend/src/assetHubWestend.peopleWestend.test.ts b/packages/westend/src/assetHubWestend.peopleWestend.test.ts new file mode 100644 index 000000000..96b8a2781 --- /dev/null +++ b/packages/westend/src/assetHubWestend.peopleWestend.test.ts @@ -0,0 +1,42 @@ +import { describe } from 'vitest' + +import { defaultAccounts } from '@e2e-test/networks' +import { assetHubWestend, peopleWestend } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' +import { query, tx } from '@e2e-test/shared/api' +import { runXcmPalletDown, runXcmPalletUp } from '@e2e-test/shared/xcm' + +describe('assetHubWestend & peopleWestend', async () => { + const [assetHubWestendClient, peopleClient] = await setupNetworks(assetHubWestend, peopleWestend) + + const peopleWND = peopleWestend.custom.wnd + const westendWND = assetHubWestend.custom.wnd + + runXcmPalletDown('assetHubWestend transfer WND to peopleWestend', async () => { + return { + fromChain: assetHubWestendClient, + toChain: peopleClient, + balance: query.balances, + toAccount: defaultAccounts.dave, + tx: tx.xcmPallet.limitedTeleportAssets( + westendWND, + 100 * assetHubWestend.custom.units, + tx.xcmPallet.parachainV3(1, peopleWestend.paraId!), + ), + } + }) + + runXcmPalletUp('peopleWestend transfer WND to assetHubWestend', async () => { + return { + fromChain: peopleClient, + toChain: assetHubWestendClient, + balance: query.balances, + toAccount: defaultAccounts.dave, + tx: tx.xcmPallet.limitedTeleportAssets( + peopleWND, + 100 * peopleWestend.custom.units, + tx.xcmPallet.parachainV3(1, assetHubWestendClient.config.paraId!), + ), + } + }) +}) diff --git a/packages/westend/src/assetHubWestend.westend.test.ts b/packages/westend/src/assetHubWestend.westend.test.ts new file mode 100644 index 000000000..f243552ab --- /dev/null +++ b/packages/westend/src/assetHubWestend.westend.test.ts @@ -0,0 +1,177 @@ +import { describe } from 'vitest' + +import { defaultAccounts } from '@e2e-test/networks' +import { assetHubWestend, westend } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' +import { query, tx } from '@e2e-test/shared/api' +import { runXcmPalletDown, runXcmPalletUp } from '@e2e-test/shared/xcm' + +describe('asset hub westend & westend', async () => { + const [westendClient, ahClient] = await setupNetworks(westend, assetHubWestend) + + runXcmPalletUp('Teleport WND from Asset Hub Westend to Westend', async () => { + return { + fromChain: ahClient, + toChain: westendClient, + balance: query.balances, + tx: tx.xcmPallet.executeXCM( + { + V4: [ + { + WithdrawAsset: [ + { + id: { + parents: 1, + interior: 'Here', + }, + fun: { Fungible: 100 * westend.custom.units }, + }, + ], + }, + { + SetFeesMode: { + jit_withdraw: true, + }, + }, + { + InitiateTeleport: { + assets: { + wild: 'All', + }, + dest: { + parents: 1, + interior: 'Here', + }, + xcm: [ + { + BuyExecution: { + fees: { + id: { + parents: 0, + interior: 'Here', + }, + fun: { + fungible: 500_000_000_000n, + }, + }, + weight_limit: 'unlimited', + }, + }, + { + DepositAsset: { + assets: { + wild: { + allCounted: 1, + }, + }, + beneficiary: { + parents: 0, + interior: { + x1: [ + { + accountId32: { + id: defaultAccounts.dave.addressRaw, + network: null, + }, + }, + ], + }, + }, + }, + }, + ], + }, + }, + ], + }, + { ref_time: 100_000_000_000n, proof_size: 1_000_000n }, + ), + } + }) + + runXcmPalletDown('Teleport WND from Westend to Asset Hub', async () => { + return { + fromChain: westendClient, + toChain: ahClient, + balance: query.balances, + tx: tx.xcmPallet.executeXCM( + { + V4: [ + { + WithdrawAsset: [ + { + id: { + parents: 0, + interior: 'Here', + }, + fun: { Fungible: 100 * assetHubWestend.custom.units }, + }, + ], + }, + { + SetFeesMode: { + jit_withdraw: true, + }, + }, + { + InitiateTeleport: { + assets: { + wild: 'All', + }, + dest: { + parents: 0, + interior: { + x1: [ + { + Parachain: 1000, + }, + ], + }, + }, + xcm: [ + { + BuyExecution: { + fees: { + id: { + parents: 1, + interior: 'Here', + }, + fun: { + fungible: 500_000_000_000n, + }, + }, + weight_limit: 'unlimited', + }, + }, + { + DepositAsset: { + assets: { + wild: { + allCounted: 1, + }, + }, + beneficiary: { + parents: 0, + interior: { + x1: [ + { + accountId32: { + id: defaultAccounts.dave.addressRaw, + network: null, + }, + }, + ], + }, + }, + }, + }, + ], + }, + }, + ], + }, + { ref_time: 100_000_000_000n, proof_size: 1_000_000n }, + ), + } + }) +}) diff --git a/packages/westend/src/collectivesWestend.assetHubWestend.test.ts b/packages/westend/src/collectivesWestend.assetHubWestend.test.ts deleted file mode 100644 index acca78651..000000000 --- a/packages/westend/src/collectivesWestend.assetHubWestend.test.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { assetHubWestend, collectivesWestend } from '@e2e-test/networks/chains' - -import { collectivesChainE2ETests } from '@e2e-test/shared' - -collectivesChainE2ETests(assetHubWestend, collectivesWestend, { - testSuiteName: 'collectives westend & asset hub westend', -})