diff --git a/e2e_tests/common.ts b/e2e_tests/common.ts index 20c8fe35..857d50f6 100644 --- a/e2e_tests/common.ts +++ b/e2e_tests/common.ts @@ -132,5 +132,5 @@ export { submitExtrinsic, transferRelayAssetToPara, getAddressFromModuleId, - getFreeBalance + getFreeBalance, }; diff --git a/e2e_tests/xc-transfer/region-transfer.ts b/e2e_tests/xc-transfer/region-transfer.ts index b88a7821..3d3168d1 100644 --- a/e2e_tests/xc-transfer/region-transfer.ts +++ b/e2e_tests/xc-transfer/region-transfer.ts @@ -46,6 +46,8 @@ async function run(_nodeName: any, networkInfo: any, _jsArgs: any) { const txSetBalance = coretimeApi.tx.balances.forceSetBalance(alice.address, 1000 * UNIT); await submitExtrinsic(alice, coretimeApi.tx.sudo.sudo(txSetBalance), {}); + await ismpAddParachain(alice, regionXApi); + const regionId = await purchaseRegion(coretimeApi, alice); if (!regionId) throw new Error('RegionId not found'); @@ -108,7 +110,8 @@ async function run(_nodeName: any, networkInfo: any, _jsArgs: any) { assert.equal(regions.length, 1); assert.deepStrictEqual(regions[0][0].toHuman(), [regionId]); // record is unavailable because we did not setup ismp. - assert.deepStrictEqual(regions[0][1].toHuman(), { owner: alice.address, record: 'Unavailable' }); + assert((regions[0][1].toHuman() as any).owner == alice.address); + assert(typeof (regions[0][1].toHuman() as any).record.Pending === 'string'); regions = await coretimeApi.query.broker.regions.entries(); assert.equal(regions.length, 1); @@ -174,6 +177,12 @@ async function run(_nodeName: any, networkInfo: any, _jsArgs: any) { assert.equal((regions[0][1].toHuman() as any).owner, alice.address); } +async function ismpAddParachain(signer: KeyringPair, regionXApi: ApiPromise) { + const addParaCall = regionXApi.tx.ismpParachain.addParachain([1005]); + const sudoCall = regionXApi.tx.sudo.sudo(addParaCall); + return submitExtrinsic(signer, sudoCall, {}); +} + async function openHrmpChannel( signer: KeyringPair, relayApi: ApiPromise, diff --git a/package.json b/package.json index 500c81b0..a833f258 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "author": "", "license": "ISC", "dependencies": { + "@jest/globals": "^29.7.0", "@polkadot/api": "^11.0.2", "@polkadot/keyring": "^12.6.2", "@polkadot/util": "^12.6.2",