difftreelog
add 942057 migration scripts
in: master
5 files changed
tests/src/migrations/942057-appPromotion/collect-data.shdiffbeforeafterboth--- /dev/null
+++ b/tests/src/migrations/942057-appPromotion/collect-data.sh
@@ -0,0 +1 @@
+chainql --tla-str=chainUrl=ws://127.0.0.1:9944 stakersParser.jsonnet > output.json
\ No newline at end of file
tests/src/migrations/942057-appPromotion/collectData.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/migrations/942057-appPromotion/collectData.ts
@@ -0,0 +1,3 @@
+import {spawnSync} from 'child_process';
+
+export const collectData = () => spawnSync('sh', ['./collect-data.sh']);
tests/src/migrations/942057-appPromotion/correctStateAfterMaintenance.tsdiffbeforeafterboth494950 const failedBlocks: bigint[] = [];50 const failedBlocks: bigint[] = [];51 let isSuccess = true;51 let isSuccess = true;52 await helper.wait.newBlocks(1);535254 for(const b of filteredBlocks) {53 for(const b of filteredBlocks) {55 if(((await api.query.appPromotion.pendingUnstake(b)).toJSON() as any[]).length != 0) {54 if(((await api.query.appPromotion.pendingUnstake(b)).toJSON() as any[]).length != 0) {tests/src/migrations/942057-appPromotion/index.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/migrations/942057-appPromotion/index.ts
@@ -0,0 +1,12 @@
+import {Migration} from '../../util/frankensteinMigrate';
+import {collectData} from './collectData';
+import {migrateLockedToFreeze} from './lockedToFreeze';
+
+export const migration: Migration = {
+ async before() {
+ await collectData();
+ },
+ async after() {
+ await migrateLockedToFreeze();
+ },
+};
tests/src/migrations/942057-appPromotion/lockedToFreeze.tsdiffbeforeafterboth--- a/tests/src/migrations/942057-appPromotion/lockedToFreeze.ts
+++ b/tests/src/migrations/942057-appPromotion/lockedToFreeze.ts
@@ -13,7 +13,7 @@
return isInteger(value) ? BigInt(value) : parseFloat(value);
}
-const main = async(options: { wsEndpoint: string; donorSeed: string } = {
+export const migrateLockedToFreeze = async(options: { wsEndpoint: string; donorSeed: string } = {
wsEndpoint: WS_ENDPOINT,
donorSeed: DONOR_SEED,
}) => {
@@ -254,12 +254,3 @@
}
console.log('Chainql data correct');
};
-
-main({
- wsEndpoint: process.env.WS_RPC!,
- donorSeed: process.env.SUPERUSER_SEED!,
-}).then(() => process.exit(0))
- .catch((e) => {
- console.error(e);
- process.exit(1);
- });
\ No newline at end of file