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:
Nicolás Venturo
2020-04-02 15:29:58 -03:00
committed by GitHub
parent 1bc923b6a2
commit 5b5d91c9d4
13 changed files with 77 additions and 63 deletions

View File

@ -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);