Remove 'external' functions (#2162)
* Remove _grantRole and _revokeRole, replace with _setupRole * Make all external AccessControl functions public * Remove Ownable._transferOwnership * Rename ERC721's _safeTransferFrom and _transferFrom to _safeTransfer and _transfer * Make all ERC721 external functions public * Make all miscelaneous external functions public instead * Add changelog entry * Move calldata arguments to memory * Update contracts/access/AccessControl.sol Co-Authored-By: Francisco Giordano <frangio.1@gmail.com> * Restrict setupRole to the constructor * Replace isConstructor for !isContract Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
@ -17,6 +17,15 @@ 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);
|
||||
|
||||
Reference in New Issue
Block a user