diff --git a/e2e_tests/common.ts b/e2e_tests/common.ts index 2f66ff93..06462d7f 100644 --- a/e2e_tests/common.ts +++ b/e2e_tests/common.ts @@ -134,8 +134,14 @@ const getFreeBalance = async (api: ApiPromise, address: string): Promise return BigInt(free); }; +function log(message: string) { + // Green log. + console.log('\x1b[32m%s\x1b[0m', message); +} + export { RELAY_ASSET_ID, + log, setupRelayAsset, sleep, openHrmpChannel, diff --git a/e2e_tests/order/processing.ts b/e2e_tests/order/processing.ts index 088c12d9..0558704b 100644 --- a/e2e_tests/order/processing.ts +++ b/e2e_tests/order/processing.ts @@ -3,6 +3,7 @@ import { KeyringPair } from '@polkadot/keyring/types'; import { getEncodedRegionId, RegionId } from 'coretime-utils'; import assert from 'node:assert'; import { + log, openHrmpChannel, RELAY_ASSET_ID, setupRelayAsset, @@ -33,31 +34,40 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) { const alice = keyring.addFromUri('//Alice'); const bob = keyring.addFromUri('//Bob'); - const txSetCoretimeXcmVersion = coretimeApi.tx.polkadotXcm.forceDefaultXcmVersion([3]); const txSetRelayXcmVersion = rococoApi.tx.xcmPallet.forceDefaultXcmVersion([3]); - await submitExtrinsic(alice, coretimeApi.tx.sudo.sudo(txSetCoretimeXcmVersion), {}); + const txSetCoretimeXcmVersion = coretimeApi.tx.polkadotXcm.forceDefaultXcmVersion([3]); + log('Setting XCM version: '); await submitExtrinsic(alice, rococoApi.tx.sudo.sudo(txSetRelayXcmVersion), {}); + await submitExtrinsic(alice, coretimeApi.tx.sudo.sudo(txSetCoretimeXcmVersion), {}); + log('Setting up relay asset: '); await setupRelayAsset(regionXApi, alice, 500n * UNIT); + log('Opening HRMP: '); await openHrmpChannel(alice, rococoApi, 1005, 2000); await openHrmpChannel(alice, rococoApi, 2000, 1005); + log('Adding ISMP: '); await ismpAddParachain(alice, regionXApi); // Needed for fee payment // Alice has relay tokens on Coretime chain by default, so no need to send there. + log('Transfering rc token to RegionX:'); await transferRelayAssetToPara(UNIT, 2000, rococoApi, alice); // 1. A region is listed on sale + log('Configuring coretime chain:'); await configureBroker(coretimeApi, alice); + log('Starting sales:'); await startSales(coretimeApi, alice); + log('Giving alice balance on Coretime chain:'); const txSetBalance = coretimeApi.tx.balances.forceSetBalance(alice.address, 1000n * UNIT); await submitExtrinsic(alice, coretimeApi.tx.sudo.sudo(txSetBalance), {}); const regionId = await purchaseRegion(coretimeApi, alice); if (!regionId) throw new Error('RegionId not found'); + log('Transferring region to RegionX'); await transferRegionToRegionX(coretimeApi, regionXApi, alice, regionId); // 2. An order is created diff --git a/package.json b/package.json index ca99c5a0..63a7b1ce 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "author": "", "license": "ISC", "dependencies": { - "@polkadot/api": "^11.0.2", + "@polkadot/api": "^11.2.1", "@polkadot/keyring": "^12.6.2", "@polkadot/util": "^12.6.2", "@polkadot/util-crypto": "^12.6.2",