From 3305c0e9e5ab6281ded08198fb877e0a1232e505 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Wed, 20 Nov 2024 16:10:44 +0200 Subject: [PATCH] fix: clean up --- scenario/constraints/MigrationConstraint.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/scenario/constraints/MigrationConstraint.ts b/scenario/constraints/MigrationConstraint.ts index 01401138f..a0c2b16a2 100644 --- a/scenario/constraints/MigrationConstraint.ts +++ b/scenario/constraints/MigrationConstraint.ts @@ -1,7 +1,7 @@ import { StaticConstraint, Solution, World, debug } from '../../plugins/scenario'; import { CometContext, MigrationData } from '../context/CometContext'; import { Migration, loadMigrations, Actions } from '../../plugins/deployment_manager/Migration'; -import { modifiedPaths } from '../utils'; +import { modifiedPaths, subsets } from '../utils'; import { DeploymentManager } from '../../plugins/deployment_manager'; import { impersonateAddress } from '../../plugins/scenario/utils'; import { exp } from '../../test/helpers'; @@ -22,17 +22,7 @@ export class MigrationConstraint implements StaticConstr async solve(world: World) { const label = `[${world.base.name}] {MigrationConstraint}`; const solutions: Solution[] = []; - const migrations = await getMigrations(world); - - // remove enacted migrations - for(let i = 0; i < migrations.length; i++) { - if (await isEnacted(migrations[i].actions, world.deploymentManager, world.deploymentManager)) { - migrations.splice(i, 1); - i--; - } - } - - const migrationPaths = [migrations]; + const migrationPaths = [...subsets(await getMigrations(world))]; for (const migrationList of migrationPaths) { if (migrationList.length == 0 && migrationPaths.length > 1) {