Killable.js 571 B

123456789101112131415161718
  1. 'use strict';
  2. var Killable = artifacts.require('../contracts/lifecycle/Killable.sol');
  3. require('./helpers/transactionMined.js');
  4. contract('Killable', function(accounts) {
  5. it('should send balance to owner after death', async function() {
  6. let killable = await Killable.new({from: accounts[0], value: web3.toWei('10','ether')});
  7. let owner = await killable.owner();
  8. let initBalance = web3.eth.getBalance(owner);
  9. await killable.kill({from: owner});
  10. let newBalance = web3.eth.getBalance(owner);
  11. assert.isTrue(newBalance > initBalance);
  12. });
  13. });