Commit 82c85121 by zava Committed by Alejandro Santander

changed Inherited event for OwnershipTransfered

parent e5960465
...@@ -23,7 +23,6 @@ contract Inheritable is Ownable { ...@@ -23,7 +23,6 @@ contract Inheritable is Ownable {
event HeirChanged(address indexed owner, address indexed newHeir); event HeirChanged(address indexed owner, address indexed newHeir);
event OwnerHeartbeated(address indexed owner); event OwnerHeartbeated(address indexed owner);
event OwnerProclaimedDead(address indexed owner, address indexed heir, uint timeOfDeath); event OwnerProclaimedDead(address indexed owner, address indexed heir, uint timeOfDeath);
event Inherited(address indexed previousOwner, address indexed newOwner);
/** /**
...@@ -83,7 +82,7 @@ contract Inheritable is Ownable { ...@@ -83,7 +82,7 @@ contract Inheritable is Ownable {
function inherit() public onlyHeir { function inherit() public onlyHeir {
require(!ownerLives()); require(!ownerLives());
require(now >= timeOfDeath + heartbeatTimeout); require(now >= timeOfDeath + heartbeatTimeout);
Inherited(owner, heir); OwnershipTransferred(owner, heir);
owner = heir; owner = heir;
timeOfDeath = 0; timeOfDeath = 0;
} }
......
...@@ -128,7 +128,7 @@ contract('Inheritable', function(accounts) { ...@@ -128,7 +128,7 @@ contract('Inheritable', function(accounts) {
await increaseTime(4141) await increaseTime(4141)
const inheritLogs = (await inheritable.inherit({from: heir})).logs const inheritLogs = (await inheritable.inherit({from: heir})).logs
const ownershipTransferredEvent = inheritLogs.find(e => e.event === 'Inherited') const ownershipTransferredEvent = inheritLogs.find(e => e.event === 'OwnershipTransferred')
assert.isTrue(ownershipTransferredEvent.args.previousOwner === owner) assert.isTrue(ownershipTransferredEvent.args.previousOwner === owner)
assert.isTrue(ownershipTransferredEvent.args.newOwner === heir) assert.isTrue(ownershipTransferredEvent.args.newOwner === heir)
......
'use strict'
const SimpleSavingsWallet = artifacts.require('../contracts/examples/SimpleSavingsWallet.sol')
contract('SimpleSavingsWallet', function(accounts) {
let savingsWallet
let owner
beforeEach(async function() {
savingsWallet = await SimpleSavingsWallet.new(4141)
owner = await inheritable.owner()
})
it('should receive funds', async function() {
await web3.eth.sendTransaction({from: owner, to: this.contract.address, value: amount})
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment