@@ -7,7 +7,7 @@ import { soliditySha3 } from "web3-utils";
7
7
8
8
import { UINT256_MAX , WAD } from "../../helpers/constants" ;
9
9
import { setupEtherRouter } from "../../helpers/upgradable-contracts" ;
10
- import { checkErrorRevert , web3GetCode } from "../../helpers/test-helper" ;
10
+ import { checkErrorRevert , web3GetCode , getExtensionAddressFromTx } from "../../helpers/test-helper" ;
11
11
import { setupColonyNetwork , setupRandomColony , setupMetaColonyWithLockedCLNYToken } from "../../helpers/test-data-generator" ;
12
12
13
13
const { expect } = chai ;
@@ -46,9 +46,8 @@ contract("EvaluatedExpenditure", (accounts) => {
46
46
beforeEach ( async ( ) => {
47
47
( { colony } = await setupRandomColony ( colonyNetwork ) ) ;
48
48
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 ) ;
52
51
evaluatedExpenditure = await EvaluatedExpenditure . at ( evaluatedExpenditureAddress ) ;
53
52
54
53
await colony . setArbitrationRole ( 1 , UINT256_MAX , evaluatedExpenditure . address , 1 , true ) ;
@@ -79,16 +78,12 @@ contract("EvaluatedExpenditure", (accounts) => {
79
78
80
79
it ( "can install the extension with the extension manager" , async ( ) => {
81
80
( { 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 ) ;
88
82
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" ) ;
90
85
91
- await colony . uninstallExtension ( EVALUATED_EXPENDITURE , { from : USER0 } ) ;
86
+ await colony . methods [ " uninstallExtension(address)" ] ( evaluatedExpenditureAddress , { from : USER0 } ) ;
92
87
} ) ;
93
88
} ) ;
94
89
0 commit comments