git.delta.rocks / unique-network / refs/commits / 7fd12913e12e

difftreelog

Add some logs about migration

Max Andreev2023-06-09parent: #5666452.patch.diff
in: master

1 file changed

modifiedtests/src/util/frankenstein.tsdiffbeforeafterboth
247 }247 }
248248
249 const migration = migrations[process.env.DESTINATION_SPEC_VERSION!];249 const migration = migrations[process.env.DESTINATION_SPEC_VERSION!];
250 console.log('⭐️⭐️⭐️ DESTINATION_SPEC_VERSION ⭐️⭐️⭐️', process.env.DESTINATION_SPEC_VERSION!);
250 for(const paraId in network.paras) {251 for(const paraId in network.paras) {
251 console.log(`\n--- Upgrading the runtime of parachain ${paraId} \t---`);252 console.log(`\n--- Upgrading the runtime of parachain ${paraId} \t---`);
252 const para = network.paras[paraId];253 const para = network.paras[paraId];
253254
254 // Enable maintenance mode if present255 // Enable maintenance mode if present
255 await toggleMaintenanceMode(true, para.nodes[0].wsUri);256 await toggleMaintenanceMode(true, para.nodes[0].wsUri);
256 if(migration) await migration.before();257 if(migration) {
258 console.log('⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️');
259 console.log('⭐️⭐️⭐️ Running pre-upgrade scripts... ⭐️⭐️⭐️');
260 console.log('⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️');
261 await migration.before();
262 }
257263
258 // Read the WASM code and authorize the upgrade with its hash and set it as the new runtime264 // Read the WASM code and authorize the upgrade with its hash and set it as the new runtime
259 const code = fs.readFileSync(NEW_PARA_WASM);265 const code = fs.readFileSync(NEW_PARA_WASM);
328 // Disable maintenance mode if present334 // Disable maintenance mode if present
329 for(const paraId in network.paras) {335 for(const paraId in network.paras) {
330 // TODO only if our parachain336 // TODO only if our parachain
331 if(migration) await migration.after();337 if(migration) {
338 console.log('⭐️⭐️⭐️ Running post-upgrade scripts... ⭐️⭐️⭐️');
339 await migration.after();
340 }
332 await toggleMaintenanceMode(false, network.paras[paraId].nodes[0].wsUri);341 await toggleMaintenanceMode(false, network.paras[paraId].nodes[0].wsUri);
333 }342 }
334 } else {343 } else {