Skip to content

Commit

Permalink
Added address of pauser/unpauser in events (#1410)
Browse files Browse the repository at this point in the history
* Added address of pauser/unpauser in events

* Added the account to the Pausable tests.
  • Loading branch information
Glisch authored and nventuro committed Oct 18, 2018
1 parent cbe4148 commit fcab9c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions contracts/lifecycle/Pausable.sol
Expand Up @@ -7,8 +7,8 @@ import "../access/roles/PauserRole.sol";
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is PauserRole {
event Paused();
event Unpaused();
event Paused(address account);
event Unpaused(address account);

bool private _paused;

Expand Down Expand Up @@ -44,14 +44,14 @@ contract Pausable is PauserRole {
*/
function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused();
emit Paused(msg.sender);
}

/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyPauser whenPaused {
_paused = false;
emit Unpaused();
emit Unpaused(msg.sender);
}
}
4 changes: 2 additions & 2 deletions test/lifecycle/Pausable.test.js
Expand Up @@ -57,7 +57,7 @@ contract('Pausable', function ([_, pauser, otherPauser, anyone, ...otherAccounts
});

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 () {
Expand Down Expand Up @@ -89,7 +89,7 @@ contract('Pausable', function ([_, pauser, otherPauser, anyone, ...otherAccounts
});

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 () {
Expand Down

0 comments on commit fcab9c8

Please sign in to comment.