From f1de64dcafa9f86ad57c7e38501ba8e9425d3e8e Mon Sep 17 00:00:00 2001 From: Lawrence Forman Date: Tue, 28 Apr 2020 12:07:09 -0400 Subject: [PATCH] `@0x/contracts-zero-ex`: Make `Ownable` feature conform to `IOwnable`. --- contracts/zero-ex/contracts/src/features/Ownable.sol | 4 ++-- contracts/zero-ex/contracts/test/TestMigrator.sol | 4 ++-- contracts/zero-ex/test/features/ownable_test.ts | 4 ++-- contracts/zero-ex/test/initial_migration_test.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contracts/zero-ex/contracts/src/features/Ownable.sol b/contracts/zero-ex/contracts/src/features/Ownable.sol index 2946664ffc..e4d95c097d 100644 --- a/contracts/zero-ex/contracts/src/features/Ownable.sol +++ b/contracts/zero-ex/contracts/src/features/Ownable.sol @@ -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; } } diff --git a/contracts/zero-ex/contracts/test/TestMigrator.sol b/contracts/zero-ex/contracts/test/TestMigrator.sol index 71393a4018..f81a589fd3 100644 --- a/contracts/zero-ex/contracts/test/TestMigrator.sol +++ b/contracts/zero-ex/contracts/test/TestMigrator.sol @@ -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; } diff --git a/contracts/zero-ex/test/features/ownable_test.ts b/contracts/zero-ex/test/features/ownable_test.ts index 88bf408143..428e6f0c9b 100644 --- a/contracts/zero-ex/test/features/ownable_test.ts +++ b/contracts/zero-ex/test/features/ownable_test.ts @@ -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 () => { diff --git a/contracts/zero-ex/test/initial_migration_test.ts b/contracts/zero-ex/test/initial_migration_test.ts index defbad5c20..e83945dbff 100644 --- a/contracts/zero-ex/test/initial_migration_test.ts +++ b/contracts/zero-ex/test/initial_migration_test.ts @@ -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); }); });