changed Inherited event for OwnershipTransfered

pull/680/head
zava 7 years ago committed by Alejandro Santander
parent e5960465a7
commit 82c85121bb
  1. 3
      contracts/ownership/Inheritable.sol
  2. 2
      test/Inheritable.js
  3. 16
      test/SimpleSavingsWallet.js

@ -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)

@ -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})
})
Loading…
Cancel
Save