No longer assigning awaits to temporary variables. (#1216)

This commit is contained in:
Nicolás Venturo
2018-08-17 16:10:40 -03:00
committed by GitHub
parent df9426f989
commit 20cf885430
43 changed files with 231 additions and 467 deletions

View File

@ -49,18 +49,15 @@ contract('SplitPayment', function ([_, owner, payee1, payee2, payee3, nonpayee1,
it('should accept payments', async function () {
await ethSendTransaction({ from: owner, to: this.contract.address, value: amount });
const balance = await ethGetBalance(this.contract.address);
balance.should.be.bignumber.equal(amount);
(await ethGetBalance(this.contract.address)).should.be.bignumber.equal(amount);
});
it('should store shares if address is payee', async function () {
const shares = await this.contract.shares.call(payee1);
shares.should.be.bignumber.not.eq(0);
(await this.contract.shares.call(payee1)).should.be.bignumber.not.eq(0);
});
it('should not store shares if address is not payee', async function () {
const shares = await this.contract.shares.call(nonpayee1);
shares.should.be.bignumber.equal(0);
(await this.contract.shares.call(nonpayee1)).should.be.bignumber.equal(0);
});
it('should throw if no funds to claim', async function () {
@ -96,12 +93,10 @@ contract('SplitPayment', function ([_, owner, payee1, payee2, payee3, nonpayee1,
profit3.sub(web3.toWei(0.70, 'ether')).abs().should.be.bignumber.lt(1e16);
// end balance should be zero
const endBalance = await ethGetBalance(this.contract.address);
endBalance.should.be.bignumber.equal(0);
(await ethGetBalance(this.contract.address)).should.be.bignumber.equal(0);
// check correct funds released accounting
const totalReleased = await this.contract.totalReleased.call();
totalReleased.should.be.bignumber.equal(initBalance);
(await this.contract.totalReleased.call()).should.be.bignumber.equal(initBalance);
});
});
});