Browse Source

changed Inherited event for OwnershipTransfered

zava 7 years ago
parent
commit
82c85121bb
3 changed files with 18 additions and 3 deletions
  1. 1 2
      contracts/ownership/Inheritable.sol
  2. 1 1
      test/Inheritable.js
  3. 16 0
      test/SimpleSavingsWallet.js

+ 1 - 2
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;
   }

+ 1 - 1
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)

+ 16 - 0
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})
+  })