@0x/contracts-zero-ex: Make Ownable feature conform to IOwnable.

This commit is contained in:
Lawrence Forman 2020-04-28 12:07:09 -04:00
parent feb672c3cd
commit f1de64dcaf
4 changed files with 7 additions and 7 deletions

View File

@ -63,7 +63,7 @@ contract Ownable is
// Register feature functions.
ISimpleFunctionRegistry(address(this)).extend(this.transferOwnership.selector, _implementation);
ISimpleFunctionRegistry(address(this)).extend(this.getOwner.selector, _implementation);
ISimpleFunctionRegistry(address(this)).extend(this.owner.selector, _implementation);
ISimpleFunctionRegistry(address(this)).extend(this.migrate.selector, _implementation);
return LibBootstrap.BOOTSTRAP_SUCCESS;
}
@ -119,7 +119,7 @@ contract Ownable is
/// @dev Get the owner of this contract.
/// @return owner_ The owner of this contract.
function getOwner() external override view returns (address owner_) {
function owner() external override view returns (address owner_) {
return LibOwnableStorage.getStorage().owner;
}
}

View File

@ -32,7 +32,7 @@ contract TestMigrator {
function succeedingMigrate() external returns (bytes4 success) {
emit TestMigrateCalled(
msg.data,
IOwnable(address(this)).getOwner()
IOwnable(address(this)).owner()
);
return LibMigrate.MIGRATE_SUCCESS;
}
@ -40,7 +40,7 @@ contract TestMigrator {
function failingMigrate() external returns (bytes4 success) {
emit TestMigrateCalled(
msg.data,
IOwnable(address(this)).getOwner()
IOwnable(address(this)).owner()
);
return 0xdeadbeef;
}

View File

@ -51,7 +51,7 @@ blockchainTests.resets('Ownable feature', env => {
],
IOwnableEvents.OwnershipTransferred,
);
expect(await ownable.getOwner().callAsync()).to.eq(newOwner);
expect(await ownable.owner().callAsync()).to.eq(newOwner);
});
});
@ -80,7 +80,7 @@ blockchainTests.resets('Ownable feature', env => {
],
TestMigratorEvents.TestMigrateCalled,
);
expect(await ownable.getOwner().callAsync()).to.eq(newOwner);
expect(await ownable.owner().callAsync()).to.eq(newOwner);
});
it('failing migration reverts', async () => {

View File

@ -45,7 +45,7 @@ blockchainTests.resets('Initial migration', env => {
});
it('has the correct owner', async () => {
const actualOwner = await ownable.getOwner().callAsync();
const actualOwner = await ownable.owner().callAsync();
expect(actualOwner).to.eq(owner);
});
});