@0x/contracts-zero-ex
: Make Ownable
feature conform to IOwnable
.
This commit is contained in:
@@ -63,7 +63,7 @@ contract Ownable is
|
|||||||
|
|
||||||
// Register feature functions.
|
// Register feature functions.
|
||||||
ISimpleFunctionRegistry(address(this)).extend(this.transferOwnership.selector, _implementation);
|
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);
|
ISimpleFunctionRegistry(address(this)).extend(this.migrate.selector, _implementation);
|
||||||
return LibBootstrap.BOOTSTRAP_SUCCESS;
|
return LibBootstrap.BOOTSTRAP_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,7 @@ contract Ownable is
|
|||||||
|
|
||||||
/// @dev Get the owner of this contract.
|
/// @dev Get the owner of this contract.
|
||||||
/// @return owner_ 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;
|
return LibOwnableStorage.getStorage().owner;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,7 @@ contract TestMigrator {
|
|||||||
function succeedingMigrate() external returns (bytes4 success) {
|
function succeedingMigrate() external returns (bytes4 success) {
|
||||||
emit TestMigrateCalled(
|
emit TestMigrateCalled(
|
||||||
msg.data,
|
msg.data,
|
||||||
IOwnable(address(this)).getOwner()
|
IOwnable(address(this)).owner()
|
||||||
);
|
);
|
||||||
return LibMigrate.MIGRATE_SUCCESS;
|
return LibMigrate.MIGRATE_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ contract TestMigrator {
|
|||||||
function failingMigrate() external returns (bytes4 success) {
|
function failingMigrate() external returns (bytes4 success) {
|
||||||
emit TestMigrateCalled(
|
emit TestMigrateCalled(
|
||||||
msg.data,
|
msg.data,
|
||||||
IOwnable(address(this)).getOwner()
|
IOwnable(address(this)).owner()
|
||||||
);
|
);
|
||||||
return 0xdeadbeef;
|
return 0xdeadbeef;
|
||||||
}
|
}
|
||||||
|
@@ -51,7 +51,7 @@ blockchainTests.resets('Ownable feature', env => {
|
|||||||
],
|
],
|
||||||
IOwnableEvents.OwnershipTransferred,
|
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,
|
TestMigratorEvents.TestMigrateCalled,
|
||||||
);
|
);
|
||||||
expect(await ownable.getOwner().callAsync()).to.eq(newOwner);
|
expect(await ownable.owner().callAsync()).to.eq(newOwner);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('failing migration reverts', async () => {
|
it('failing migration reverts', async () => {
|
||||||
|
@@ -45,7 +45,7 @@ blockchainTests.resets('Initial migration', env => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('has the correct owner', async () => {
|
it('has the correct owner', async () => {
|
||||||
const actualOwner = await ownable.getOwner().callAsync();
|
const actualOwner = await ownable.owner().callAsync();
|
||||||
expect(actualOwner).to.eq(owner);
|
expect(actualOwner).to.eq(owner);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user