fixes gh-109: resolve conflict between Ownable and ERC20 token.
This commit is contained in:
@ -19,7 +19,7 @@ contract Ownable {
|
|||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
|
|
||||||
function transfer(address newOwner) onlyOwner {
|
function transferOwnership(address newOwner) onlyOwner {
|
||||||
if (newOwner != address(0)) owner = newOwner;
|
if (newOwner != address(0)) owner = newOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ contract('Ownable', function(accounts) {
|
|||||||
|
|
||||||
it("changes owner after transfer", async function() {
|
it("changes owner after transfer", async function() {
|
||||||
let other = accounts[1];
|
let other = accounts[1];
|
||||||
let transfer = await ownable.transfer(other);
|
let transfer = await ownable.transferOwnership(other);
|
||||||
let owner = await ownable.owner();
|
let owner = await ownable.owner();
|
||||||
|
|
||||||
assert.isTrue(owner === other);
|
assert.isTrue(owner === other);
|
||||||
@ -20,7 +20,7 @@ contract('Ownable', function(accounts) {
|
|||||||
|
|
||||||
it("should prevent non-owners from transfering", async function() {
|
it("should prevent non-owners from transfering", async function() {
|
||||||
let other = accounts[2];
|
let other = accounts[2];
|
||||||
let transfer = await ownable.transfer(other, {from: accounts[2]});
|
let transfer = await ownable.transferOwnership(other, {from: accounts[2]});
|
||||||
let owner = await ownable.owner();
|
let owner = await ownable.owner();
|
||||||
|
|
||||||
assert.isFalse(owner === other);
|
assert.isFalse(owner === other);
|
||||||
@ -29,7 +29,7 @@ contract('Ownable', function(accounts) {
|
|||||||
it("should guard ownership against stuck state", async function() {
|
it("should guard ownership against stuck state", async function() {
|
||||||
let ownable = Ownable.deployed();
|
let ownable = Ownable.deployed();
|
||||||
let originalOwner = await ownable.owner();
|
let originalOwner = await ownable.owner();
|
||||||
let transfer = await ownable.transfer(null, {from: originalOwner});
|
let transfer = await ownable.transferOwnership(null, {from: originalOwner});
|
||||||
let newOwner = await ownable.owner();
|
let newOwner = await ownable.owner();
|
||||||
|
|
||||||
assert.equal(originalOwner, newOwner);
|
assert.equal(originalOwner, newOwner);
|
||||||
|
|||||||
Reference in New Issue
Block a user