--- a/.env +++ b/.env @@ -1,6 +1,6 @@ RUST_TOOLCHAIN=nightly-2022-11-15 POLKADOT_LAUNCH_BRANCH=unique-network -RELAY_CHAIN_TYPE=rococo +RELAY_CHAIN_TYPE=westend CHAINQL=v0.4.1 DESTINATION_SPEC_VERSION=v942057 --- a/tests/src/migrations/942057-appPromotion/README.md +++ b/tests/src/migrations/942057-appPromotion/README.md @@ -31,10 +31,12 @@ ## Execute offchain migration -To run, you need to add an environment variable (`SUPERUSER_SEED`) with the sudo key seed. +To run, you need to set an environment variables: +- `SUPERUSER_SEED` – the sudo key seed. +- `WS_RPC` – the network address -Run the script by executing the following command: +Run the migration by executing the following command: ```sh -npx ts-node --esm lockedToFreeze.ts -``` \ No newline at end of file +npx ts-node --esm executeMigration.ts +``` --- a/tests/src/migrations/942057-appPromotion/collectData.ts +++ b/tests/src/migrations/942057-appPromotion/collectData.ts @@ -1,4 +1,4 @@ -import {exec, execSync} from 'child_process'; +import {exec} from 'child_process'; import path from 'path'; import {dirname} from 'path'; import {fileURLToPath} from 'url'; @@ -8,7 +8,5 @@ const pathToScript = path.resolve(dirName, './stakersParser.jsonnet'); const outputPath = path.resolve(dirName, './output.json'); - // execSync(`chainql --tla-str=chainUrl=wss://ws-quartz.unique.network:443 ${pathToScript} > ${outputPath}`); - // execSync(`chainql --tla-str=chainUrl=ws://127.0.0.1:9944 ${pathToScript} > ${outputPath}`); exec(`chainql --tla-str=chainUrl=ws://127.0.0.1:9944 ${pathToScript} > ${outputPath}`); }; --- /dev/null +++ b/tests/src/migrations/942057-appPromotion/executeMigration.ts @@ -0,0 +1,11 @@ +import {migrateLockedToFreeze} from './lockedToFreeze'; + + +const WS_RPC = process.env.WS_RPC || 'wss://ws-opal.unique.network:443'; +const SUPERUSER_SEED = process.env.SUPERUSER_SEED || ''; + +migrateLockedToFreeze({ + wsEndpoint: WS_RPC, + donorSeed: SUPERUSER_SEED, +}) + .catch(console.error); \ No newline at end of file --- a/tests/src/util/frankenstein.ts +++ b/tests/src/util/frankenstein.ts @@ -263,9 +263,7 @@ // Enable maintenance mode if present await toggleMaintenanceMode(true, para.nodes[0].wsUri); if(migration) { - console.log('⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️'); console.log('⭐️⭐️⭐️ Running pre-upgrade scripts... ⭐️⭐️⭐️'); - console.log('⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️'); await migration.before(); }