ソースを参照

Switch function name to destroyAndSend

Maxim Averin 8 年 前
コミット
cf7bc06856
3 ファイル変更3 行追加4 行削除
  1. 1 2
      contracts/lifecycle/Destructible.sol
  2. 1 1
      docs/source/killable.rst
  3. 1 1
      test/Destructible.js

+ 1 - 2
contracts/lifecycle/Destructible.sol

@@ -7,14 +7,13 @@ import "../ownership/Ownable.sol";
 /*
  * Destructible
  * Base contract that can be destroyed by owner. All funds in contract will be sent to the owner.
- * In second function all funds will be sent to the recepient.
  */
 contract Destructible is Ownable {
   function destroy() onlyOwner {
     selfdestruct(owner);
   }
 
-  function destroyAndSendRecepient(address _recipient) onlyOwner {
+  function destroyAndSend(address _recipient) onlyOwner {
     selfdestruct(_recipient);
   }
 }

+ 1 - 1
docs/source/killable.rst

@@ -10,7 +10,7 @@ destroy( ) onlyOwner
 
 Destroys the contract and sends funds back to the owner.
 
-destroyAndSendRecepient(address _recipient) onlyOwner
+destroyAndSend(address _recipient) onlyOwner
 """""""""""""""""""
 
 Destroys the contract and sends funds back to the _recepient.

+ 1 - 1
test/Destructible.js

@@ -18,7 +18,7 @@ contract('Destructible', function(accounts) {
     let destructible = await Destructible.new({from: accounts[0], value: web3.toWei('10','ether')});
     let owner = await destructible.owner();
     let initBalance = web3.eth.getBalance(accounts[1]);
-    await destructible.destroyAndSendRecepient(accounts[1], {from: owner} );
+    await destructible.destroyAndSend(accounts[1], {from: owner} );
     let newBalance = web3.eth.getBalance(accounts[1]);
     assert.isTrue(newBalance.greaterThan(initBalance));
   });