Unverified Commit 90058040 by Nicolás Venturo Committed by GitHub

Make AccessControl GSN compatible (#2135)

parent 63c89c77
...@@ -164,7 +164,7 @@ abstract contract AccessControl is Context { ...@@ -164,7 +164,7 @@ abstract contract AccessControl is Context {
*/ */
function _grantRole(bytes32 role, address account) internal virtual { function _grantRole(bytes32 role, address account) internal virtual {
if (_roles[role].members.add(account)) { if (_roles[role].members.add(account)) {
emit RoleGranted(role, account, msg.sender); emit RoleGranted(role, account, _msgSender());
} }
} }
...@@ -175,7 +175,7 @@ abstract contract AccessControl is Context { ...@@ -175,7 +175,7 @@ abstract contract AccessControl is Context {
*/ */
function _revokeRole(bytes32 role, address account) internal virtual { function _revokeRole(bytes32 role, address account) internal virtual {
if (_roles[role].members.remove(account)) { if (_roles[role].members.remove(account)) {
emit RoleRevoked(role, account, msg.sender); emit RoleRevoked(role, account, _msgSender());
} }
} }
......
...@@ -4,7 +4,7 @@ import "../access/AccessControl.sol"; ...@@ -4,7 +4,7 @@ import "../access/AccessControl.sol";
contract AccessControlMock is AccessControl { contract AccessControlMock is AccessControl {
constructor() public { constructor() public {
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, _msgSender());
} }
function setRoleAdmin(bytes32 roleId, bytes32 adminRoleId) public { function setRoleAdmin(bytes32 roleId, bytes32 adminRoleId) public {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment