@@ -7,7 +7,7 @@ import { soliditySha3 } from "web3-utils";
77
88import { UINT256_MAX , WAD } from "../../helpers/constants" ;
99import { setupEtherRouter } from "../../helpers/upgradable-contracts" ;
10- import { checkErrorRevert , web3GetCode } from "../../helpers/test-helper" ;
10+ import { checkErrorRevert , web3GetCode , getExtensionAddressFromTx } from "../../helpers/test-helper" ;
1111import { setupColonyNetwork , setupRandomColony , setupMetaColonyWithLockedCLNYToken } from "../../helpers/test-data-generator" ;
1212
1313const { expect } = chai ;
@@ -46,9 +46,8 @@ contract("EvaluatedExpenditure", (accounts) => {
4646 beforeEach ( async ( ) => {
4747 ( { colony } = await setupRandomColony ( colonyNetwork ) ) ;
4848
49- await colony . installExtension ( EVALUATED_EXPENDITURE , evaluatedExpenditureVersion ) ;
50-
51- const evaluatedExpenditureAddress = await colonyNetwork . getExtensionInstallation ( EVALUATED_EXPENDITURE , colony . address ) ;
49+ const tx = await colony . installExtension ( EVALUATED_EXPENDITURE , evaluatedExpenditureVersion ) ;
50+ const evaluatedExpenditureAddress = getExtensionAddressFromTx ( tx ) ;
5251 evaluatedExpenditure = await EvaluatedExpenditure . at ( evaluatedExpenditureAddress ) ;
5352
5453 await colony . setArbitrationRole ( 1 , UINT256_MAX , evaluatedExpenditure . address , 1 , true ) ;
@@ -79,16 +78,12 @@ contract("EvaluatedExpenditure", (accounts) => {
7978
8079 it ( "can install the extension with the extension manager" , async ( ) => {
8180 ( { colony } = await setupRandomColony ( colonyNetwork ) ) ;
82- await colony . installExtension ( EVALUATED_EXPENDITURE , evaluatedExpenditureVersion , { from : USER0 } ) ;
83-
84- await checkErrorRevert (
85- colony . installExtension ( EVALUATED_EXPENDITURE , evaluatedExpenditureVersion , { from : USER0 } ) ,
86- "colony-network-extension-already-installed"
87- ) ;
81+ const tx = await colony . installExtension ( EVALUATED_EXPENDITURE , evaluatedExpenditureVersion ) ;
8882
89- await checkErrorRevert ( colony . uninstallExtension ( EVALUATED_EXPENDITURE , { from : USER1 } ) , "ds-auth-unauthorized" ) ;
83+ const evaluatedExpenditureAddress = getExtensionAddressFromTx ( tx ) ;
84+ await checkErrorRevert ( colony . methods [ "uninstallExtension(address)" ] ( evaluatedExpenditureAddress , { from : USER1 } ) , "ds-auth-unauthorized" ) ;
9085
91- await colony . uninstallExtension ( EVALUATED_EXPENDITURE , { from : USER0 } ) ;
86+ await colony . methods [ " uninstallExtension(address)" ] ( evaluatedExpenditureAddress , { from : USER0 } ) ;
9287 } ) ;
9388 } ) ;
9489
0 commit comments