Migrated some test files, missing BN scientific notation usage.
This commit is contained in:
@ -1,17 +1,14 @@
|
||||
const shouldFail = require('../helpers/shouldFail');
|
||||
const { ZERO_ADDRESS } = require('../helpers/constants');
|
||||
const { shouldFail, constants } = require('openzeppelin-test-helpers');
|
||||
|
||||
const RolesMock = artifacts.require('RolesMock');
|
||||
|
||||
require('./../helpers/setup');
|
||||
|
||||
contract('Roles', function ([_, authorized, otherAuthorized, anyone]) {
|
||||
beforeEach(async function () {
|
||||
this.roles = await RolesMock.new();
|
||||
});
|
||||
|
||||
it('reverts when querying roles for the null account', async function () {
|
||||
await shouldFail.reverting(this.roles.has(ZERO_ADDRESS));
|
||||
await shouldFail.reverting(this.roles.has(constants.ZERO_ADDRESS));
|
||||
});
|
||||
|
||||
context('initially', function () {
|
||||
@ -34,7 +31,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) {
|
||||
});
|
||||
|
||||
it('reverts when adding roles to the null account', async function () {
|
||||
await shouldFail.reverting(this.roles.add(ZERO_ADDRESS));
|
||||
await shouldFail.reverting(this.roles.add(constants.ZERO_ADDRESS));
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -57,7 +54,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) {
|
||||
});
|
||||
|
||||
it('reverts when removing roles from the null account', async function () {
|
||||
await shouldFail.reverting(this.roles.remove(ZERO_ADDRESS));
|
||||
await shouldFail.reverting(this.roles.remove(constants.ZERO_ADDRESS));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
const shouldFail = require('../../helpers/shouldFail');
|
||||
const { ZERO_ADDRESS } = require('../../helpers/constants');
|
||||
const expectEvent = require('../../helpers/expectEvent');
|
||||
|
||||
require('../../helpers/setup');
|
||||
const { shouldFail, constants, expectEvent } = require('openzeppelin-test-helpers');
|
||||
|
||||
function capitalize (str) {
|
||||
return str.replace(/\b\w/g, l => l.toUpperCase());
|
||||
@ -27,7 +23,7 @@ function shouldBehaveLikePublicRole (authorized, otherAuthorized, [anyone], role
|
||||
}
|
||||
|
||||
it('reverts when querying roles for the null account', async function () {
|
||||
await shouldFail.reverting(this.contract[`is${rolename}`](ZERO_ADDRESS));
|
||||
await shouldFail.reverting(this.contract[`is${rolename}`](constants.ZERO_ADDRESS));
|
||||
});
|
||||
|
||||
describe('access control', function () {
|
||||
@ -67,7 +63,7 @@ function shouldBehaveLikePublicRole (authorized, otherAuthorized, [anyone], role
|
||||
});
|
||||
|
||||
it('reverts when adding role to the null account', async function () {
|
||||
await shouldFail.reverting(this.contract[`add${rolename}`](ZERO_ADDRESS, { from }));
|
||||
await shouldFail.reverting(this.contract[`add${rolename}`](constants.ZERO_ADDRESS, { from }));
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -93,7 +89,7 @@ function shouldBehaveLikePublicRole (authorized, otherAuthorized, [anyone], role
|
||||
});
|
||||
|
||||
it('reverts when removing role from the null account', async function () {
|
||||
await shouldFail.reverting(this.contract[`remove${rolename}`](ZERO_ADDRESS), { from });
|
||||
await shouldFail.reverting(this.contract[`remove${rolename}`](constants.ZERO_ADDRESS), { from });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user