changed Inherited event for OwnershipTransfered
This commit is contained in:
committed by
Alejandro Santander
parent
e5960465a7
commit
82c85121bb
@ -23,7 +23,6 @@ contract Inheritable is Ownable {
|
||||
event HeirChanged(address indexed owner, address indexed newHeir);
|
||||
event OwnerHeartbeated(address indexed owner);
|
||||
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 {
|
||||
function inherit() public onlyHeir {
|
||||
require(!ownerLives());
|
||||
require(now >= timeOfDeath + heartbeatTimeout);
|
||||
Inherited(owner, heir);
|
||||
OwnershipTransferred(owner, heir);
|
||||
owner = heir;
|
||||
timeOfDeath = 0;
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ contract('Inheritable', function(accounts) {
|
||||
|
||||
await increaseTime(4141)
|
||||
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.newOwner === heir)
|
||||
|
||||
16
test/SimpleSavingsWallet.js
Normal file
16
test/SimpleSavingsWallet.js
Normal file
@ -0,0 +1,16 @@
|
||||
'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})
|
||||
})
|
||||
Reference in New Issue
Block a user