Roles now emit events in construction and when renouncing. (#1329)

* release candidate v2.0.0-rc.1

* fix linter error

(cherry picked from commit c12a1c6898)

* Roles now emit events in construction and when renouncing.

(cherry picked from commit 21198bf1c1)
This commit is contained in:
Nicolás Venturo
2018-09-26 11:36:41 -03:00
committed by Francisco Giordano
parent dac5bccf80
commit e7c99dd7dd
5 changed files with 37 additions and 16 deletions

View File

@ -89,6 +89,11 @@ function shouldBehaveLikePublicRole (authorized, otherAuthorized, [anyone], role
(await this.contract[`is${rolename}`](authorized)).should.equal(false);
});
it(`emits a ${rolename}Removed event`, async function () {
const { logs } = await this.contract[`renounce${rolename}`]({ from: authorized });
expectEvent.inLogs(logs, `${rolename}Removed`, { account: authorized });
});
it('doesn\'t revert when renouncing unassigned role', async function () {
await this.contract[`renounce${rolename}`]({ from: anyone });
});