fix: made code cleaner. added helper. removed done from most tests.

This commit is contained in:
Angello Pozo
2016-12-01 08:42:05 -08:00
parent 688106e9c3
commit eb41a81faa
11 changed files with 116 additions and 127 deletions

View File

@ -32,7 +32,7 @@ contract('Killable', function(accounts) {
}
};
it("should send balance to owner after death", async function(done) {
it("should send balance to owner after death", async function() {
let initBalance, newBalance, owner, address, killable, kBalance, txnHash, receiptMined;
web3.eth.sendTransaction({from: web3.eth.coinbase, to: accounts[0], value: web3.toWei('50','ether')}, function(err, result) {
if(err)
@ -49,8 +49,8 @@ contract('Killable', function(accounts) {
txnHash = await killable.kill({from: owner});
receiptMined = await web3.eth.getTransactionReceiptMined(txnHash);
newBalance = web3.eth.getBalance(owner);
assert.isTrue(newBalance > initBalance);
done();
});
});