Commit fcab9c89 by Christopher Glisch Committed by Nicolás Venturo

Added address of pauser/unpauser in events (#1410)

* Added address of pauser/unpauser in events

* Added the account to the Pausable tests.
parent cbe41486
...@@ -7,8 +7,8 @@ import "../access/roles/PauserRole.sol"; ...@@ -7,8 +7,8 @@ import "../access/roles/PauserRole.sol";
* @dev Base contract which allows children to implement an emergency stop mechanism. * @dev Base contract which allows children to implement an emergency stop mechanism.
*/ */
contract Pausable is PauserRole { contract Pausable is PauserRole {
event Paused(); event Paused(address account);
event Unpaused(); event Unpaused(address account);
bool private _paused; bool private _paused;
...@@ -44,7 +44,7 @@ contract Pausable is PauserRole { ...@@ -44,7 +44,7 @@ contract Pausable is PauserRole {
*/ */
function pause() public onlyPauser whenNotPaused { function pause() public onlyPauser whenNotPaused {
_paused = true; _paused = true;
emit Paused(); emit Paused(msg.sender);
} }
/** /**
...@@ -52,6 +52,6 @@ contract Pausable is PauserRole { ...@@ -52,6 +52,6 @@ contract Pausable is PauserRole {
*/ */
function unpause() public onlyPauser whenPaused { function unpause() public onlyPauser whenPaused {
_paused = false; _paused = false;
emit Unpaused(); emit Unpaused(msg.sender);
} }
} }
...@@ -57,7 +57,7 @@ contract('Pausable', function ([_, pauser, otherPauser, anyone, ...otherAccounts ...@@ -57,7 +57,7 @@ contract('Pausable', function ([_, pauser, otherPauser, anyone, ...otherAccounts
}); });
it('emits a Paused event', function () { it('emits a Paused event', function () {
expectEvent.inLogs(this.logs, 'Paused'); expectEvent.inLogs(this.logs, 'Paused', { account: pauser });
}); });
it('cannot perform normal process in pause', async function () { it('cannot perform normal process in pause', async function () {
...@@ -89,7 +89,7 @@ contract('Pausable', function ([_, pauser, otherPauser, anyone, ...otherAccounts ...@@ -89,7 +89,7 @@ contract('Pausable', function ([_, pauser, otherPauser, anyone, ...otherAccounts
}); });
it('emits an Unpaused event', function () { it('emits an Unpaused event', function () {
expectEvent.inLogs(this.logs, 'Unpaused'); expectEvent.inLogs(this.logs, 'Unpaused', { account: pauser });
}); });
it('should resume allowing normal process', async function () { it('should resume allowing normal process', async function () {
......
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