diff --git a/contracts/ownership/Inheritable.sol b/contracts/ownership/Inheritable.sol index cce710d1f..508f6beea 100644 --- a/contracts/ownership/Inheritable.sol +++ b/contracts/ownership/Inheritable.sol @@ -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; } diff --git a/test/Inheritable.js b/test/Inheritable.js index 44536ca9b..147035c91 100644 --- a/test/Inheritable.js +++ b/test/Inheritable.js @@ -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) diff --git a/test/SimpleSavingsWallet.js b/test/SimpleSavingsWallet.js new file mode 100644 index 000000000..c51972ec8 --- /dev/null +++ b/test/SimpleSavingsWallet.js @@ -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}) + })