Update how constants is used.
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
const { constants, expectEvent, shouldFail } = require('openzeppelin-test-helpers');
|
||||
const { ZERO_ADDRESS } = constants;
|
||||
|
||||
function shouldBehaveLikeOwnable (owner, [anyone]) {
|
||||
describe('as an ownable', function () {
|
||||
@ -20,14 +21,14 @@ function shouldBehaveLikeOwnable (owner, [anyone]) {
|
||||
});
|
||||
|
||||
it('should guard ownership against stuck state', async function () {
|
||||
await shouldFail.reverting(this.ownable.transferOwnership(constants.ZERO_ADDRESS, { from: owner }));
|
||||
await shouldFail.reverting(this.ownable.transferOwnership(ZERO_ADDRESS, { from: owner }));
|
||||
});
|
||||
|
||||
it('loses owner after renouncement', async function () {
|
||||
const { logs } = await this.ownable.renounceOwnership({ from: owner });
|
||||
expectEvent.inLogs(logs, 'OwnershipTransferred');
|
||||
|
||||
(await this.ownable.owner()).should.equal(constants.ZERO_ADDRESS);
|
||||
(await this.ownable.owner()).should.equal(ZERO_ADDRESS);
|
||||
});
|
||||
|
||||
it('should prevent non-owners from renouncement', async function () {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
const { constants, expectEvent, shouldFail } = require('openzeppelin-test-helpers');
|
||||
const { ZERO_ADDRESS } = constants;
|
||||
|
||||
const SecondaryMock = artifacts.require('SecondaryMock');
|
||||
|
||||
@ -29,7 +30,7 @@ contract('Secondary', function ([_, primary, newPrimary, anyone]) {
|
||||
});
|
||||
|
||||
it('reverts when transfering to the null address', async function () {
|
||||
await shouldFail.reverting(this.secondary.transferPrimary(constants.ZERO_ADDRESS, { from: primary }));
|
||||
await shouldFail.reverting(this.secondary.transferPrimary(ZERO_ADDRESS, { from: primary }));
|
||||
});
|
||||
|
||||
it('reverts when called by anyone', async function () {
|
||||
|
||||
Reference in New Issue
Block a user