Skip to content

Commit adaeabb

Browse files
committed
Update after rebasing
1 parent b4a18b5 commit adaeabb

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

test/extensions/evaluated-expenditures.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { soliditySha3 } from "web3-utils";
77

88
import { UINT256_MAX, WAD } from "../../helpers/constants";
99
import { setupEtherRouter } from "../../helpers/upgradable-contracts";
10-
import { checkErrorRevert, web3GetCode } from "../../helpers/test-helper";
10+
import { checkErrorRevert, web3GetCode, getExtensionAddressFromTx } from "../../helpers/test-helper";
1111
import { setupColonyNetwork, setupRandomColony, setupMetaColonyWithLockedCLNYToken } from "../../helpers/test-data-generator";
1212

1313
const { 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

test/extensions/voting-rep.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,9 +1232,6 @@ contract("Voting Reputation", (accounts) => {
12321232
});
12331233

12341234
it("can take an action to install an extension", async () => {
1235-
let installation = await colonyNetwork.getExtensionInstallation(soliditySha3("OneTxPayment"), colony.address);
1236-
expect(installation).to.be.equal(ADDRESS_ZERO);
1237-
12381235
const oneTxPaymentImplementation = await OneTxPayment.new();
12391236
const resolver = await Resolver.new();
12401237
await setupEtherRouter("OneTxPayment", { OneTxPayment: oneTxPaymentImplementation.address }, resolver);
@@ -1250,11 +1247,12 @@ contract("Voting Reputation", (accounts) => {
12501247

12511248
await forwardTime(STAKE_PERIOD, this);
12521249

1253-
const { logs } = await voting.finalizeMotion(motionId);
1254-
expect(logs[1].args.executed).to.be.true;
1250+
const tx = await voting.finalizeMotion(motionId);
1251+
expect(tx.logs[1].args.executed).to.be.true;
12551252

1256-
installation = await colonyNetwork.getExtensionInstallation(soliditySha3("OneTxPayment"), colony.address);
1257-
expect(installation).to.not.be.equal(ADDRESS_ZERO);
1253+
const extensionAddress = getExtensionAddressFromTx(tx);
1254+
const colonyAddress = await colonyNetwork.getExtensionMultiInstallation(extensionAddress);
1255+
expect(colonyAddress).to.equal(colony.address);
12581256
});
12591257

12601258
it("can take an action with an arbitrary target", async () => {

0 commit comments

Comments
 (0)