@0x:contracts-utils Updated the OwnershipTransferred event to be closer to OpenZeppelin's event

This commit is contained in:
Alex Towle 2019-10-10 10:58:58 -07:00
parent 7815da7257
commit 65f2626544
3 changed files with 4 additions and 3 deletions

View File

@ -47,7 +47,7 @@ contract Ownable is
LibRichErrors.rrevert(LibOwnableRichErrors.TransferOwnerToZeroError()); LibRichErrors.rrevert(LibOwnableRichErrors.TransferOwnerToZeroError());
} else { } else {
owner = newOwner; owner = newOwner;
emit OwnershipTransferred(newOwner); emit OwnershipTransferred(msg.sender, newOwner);
} }
} }

View File

@ -22,8 +22,9 @@ pragma solidity ^0.5.9;
contract IOwnable { contract IOwnable {
/// @dev Emitted by Ownable when ownership is transferred. /// @dev Emitted by Ownable when ownership is transferred.
/// @param previousOwner The previous owner of the contract.
/// @param newOwner The new owner of the contract. /// @param newOwner The new owner of the contract.
event OwnershipTransferred(address newOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/// @dev Transfers ownership of the contract to a new address. /// @dev Transfers ownership of the contract to a new address.
/// @param newOwner The address that will become the owner. /// @param newOwner The address that will become the owner.

View File

@ -48,7 +48,7 @@ blockchainTests.resets('Ownable', env => {
receipt.logs, receipt.logs,
IOwnableEvents.OwnershipTransferred, IOwnableEvents.OwnershipTransferred,
); );
expect(event).to.be.deep.eq({ newOwner: nonOwner }); expect(event).to.be.deep.eq({ previousOwner: owner, newOwner: nonOwner });
// Ensure that the owner was actually updated // Ensure that the owner was actually updated
const updatedOwner = await ownable.owner.callAsync(); const updatedOwner = await ownable.owner.callAsync();