Remove in-constructor requirements (#2195)
* Remove isConstructor requirement from _setupRole * Remove isConstructor requirement from _setupDecimals * Update contracts/access/AccessControl.sol Co-Authored-By: Francisco Giordano <frangio.1@gmail.com> Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
@ -17,15 +17,6 @@ describe('AccessControl', function () {
|
||||
this.accessControl = await AccessControlMock.new({ from: admin });
|
||||
});
|
||||
|
||||
describe('_setupRole', function () {
|
||||
it('cannot be called outside the constructor', async function () {
|
||||
await expectRevert(
|
||||
this.accessControl.setupRole(OTHER_ROLE, other),
|
||||
'AccessControl: roles cannot be setup after construction'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('default admin', function () {
|
||||
it('deployer has default admin role', async function () {
|
||||
expect(await this.accessControl.hasRole(DEFAULT_ADMIN_ROLE, admin)).to.equal(true);
|
||||
|
||||
@ -44,12 +44,6 @@ describe('ERC20', function () {
|
||||
const token = await ERC20DecimalsMock.new(name, symbol, decimals);
|
||||
expect(await token.decimals()).to.be.bignumber.equal(decimals);
|
||||
});
|
||||
|
||||
it('reverts if setting decimals after construction', async function () {
|
||||
const token = await ERC20DecimalsMock.new(name, symbol, decimals);
|
||||
|
||||
await expectRevert(token.setupDecimals(decimals.addn(1)), 'ERC20: decimals cannot be changed after construction');
|
||||
});
|
||||
});
|
||||
|
||||
shouldBehaveLikeERC20('ERC20', initialSupply, initialHolder, recipient, anotherAccount);
|
||||
|
||||
Reference in New Issue
Block a user