@@ -17,7 +17,6 @@ import {
1717 NamedContracts ,
1818 DeployUpgradeFunc ,
1919 SetupUpgradeFunc ,
20- RunUpgradeFunc ,
2120 TeardownUpgradeFunc ,
2221 ValidateUpgradeFunc
2322} from '../../../types/types' ;
@@ -84,9 +83,11 @@ export class TestEndtoEndCoordinator implements TestCoordinator {
8483 ) : Promise < NamedContracts > {
8584 let deployedUpgradedContracts = { } ;
8685
86+ // Get the upgrade setup and teardown scripts
87+ const { deploy, setup, teardown, validate } = await import ( '@proposals/dao/' + proposalName ) ;
88+
8789 if ( config [ 'deploy' ] ) {
8890 this . config . logging && console . log ( `Applying upgrade for proposal: ${ proposalName } ` ) ;
89- const { deploy } = await import ( '../../../scripts/deploy/' + proposalName ) ;
9091 const deployTyped = deploy as DeployUpgradeFunc ;
9192 deployedUpgradedContracts = await deployTyped (
9293 this . config . deployAddress ,
@@ -109,29 +110,24 @@ export class TestEndtoEndCoordinator implements TestCoordinator {
109110 ...getAllContractAddresses ( )
110111 } ;
111112
112- // Get the upgrade setup, run and teardown scripts
113- const { setup, run, teardown, validate } = await import ( '../../../proposals/dao/' + proposalName ) ;
114-
115113 // setup the DAO proposal
116- await setup ( contractAddresses , existingContracts , contracts , this . config . logging ) ;
114+ const setupTyped = setup as SetupUpgradeFunc ;
115+ await setupTyped ( contractAddresses , existingContracts , contracts , this . config . logging ) ;
117116
118117 // Simulate the DAO proposal
119- if ( config . exec ) {
120- const proposal = await constructProposal ( proposalName , this . config . logging ) ;
121- this . config . logging && console . log ( `Simulating proposal...` ) ;
122- await proposal . simulate ( ) ;
123- } else {
124- this . config . logging && console . log ( `Running proposal...` ) ;
125- await run ( contractAddresses , existingContracts , contracts , this . config . logging ) ;
126- }
118+ const proposal = await constructProposal ( proposalName , this . config . logging ) ;
119+ this . config . logging && console . log ( `Simulating proposal...` ) ;
120+ await proposal . simulate ( ) ;
127121
128122 // teardown the DAO proposal
129123 this . config . logging && console . log ( `Running proposal teardown...` ) ;
130- await teardown ( contractAddresses , existingContracts , contracts ) ;
124+ const teardownTyped = teardown as TeardownUpgradeFunc ;
125+ await teardownTyped ( contractAddresses , existingContracts , contracts , this . config . logging ) ;
131126
132127 if ( validate ) {
133128 this . config . logging && console . log ( `Running proposal validation...` ) ;
134- await validate ( contractAddresses , existingContracts , contracts ) ;
129+ const validateTyped = validate as ValidateUpgradeFunc ;
130+ await validateTyped ( contractAddresses , existingContracts , contracts , this . config . logging ) ;
135131 }
136132
137133 return contracts ;
0 commit comments