Improves Ownable events (#1397)
* signing prefix added
* Minor improvement
* Tests changed
* Successfully tested
* Minor improvements
* Minor improvements
* Revert "Dangling commas are now required. (#1359)"
This reverts commit a6889776f4.
* updates
* fixes #1392
* event tests added
* constructor event added
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
const { expectThrow } = require('../helpers/expectThrow');
|
||||
const { EVMRevert } = require('../helpers/EVMRevert');
|
||||
const expectEvent = require('../helpers/expectEvent');
|
||||
|
||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
||||
|
||||
@ -14,7 +15,8 @@ function shouldBehaveLikeOwnable (owner, [anyone]) {
|
||||
|
||||
it('changes owner after transfer', async function () {
|
||||
(await this.ownable.isOwner({ from: anyone })).should.be.equal(false);
|
||||
await this.ownable.transferOwnership(anyone, { from: owner });
|
||||
const { logs } = await this.ownable.transferOwnership(anyone, { from: owner });
|
||||
expectEvent.inLogs(logs, 'OwnershipTransferred');
|
||||
|
||||
(await this.ownable.owner()).should.equal(anyone);
|
||||
(await this.ownable.isOwner({ from: anyone })).should.be.equal(true);
|
||||
@ -29,7 +31,9 @@ function shouldBehaveLikeOwnable (owner, [anyone]) {
|
||||
});
|
||||
|
||||
it('loses owner after renouncement', async function () {
|
||||
await this.ownable.renounceOwnership({ from: owner });
|
||||
const { logs } = await this.ownable.renounceOwnership({ from: owner });
|
||||
expectEvent.inLogs(logs, 'OwnershipTransferred');
|
||||
|
||||
(await this.ownable.owner()).should.equal(ZERO_ADDRESS);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user