balanceDifference tests and application (#1514)

* Added balanceDifference tests.

* Added balanceDifference tests.

* Now using balanceDifference in all (most) tests.

* Fixed typo.
This commit is contained in:
Nicolás Venturo
2018-11-26 15:41:39 -03:00
committed by GitHub
parent 5471fc808a
commit b9793abec6
10 changed files with 73 additions and 70 deletions

View File

@ -0,0 +1,10 @@
async function balanceDifference (account, promiseFunc) {
const balanceBefore = web3.eth.getBalance(account);
await promiseFunc();
const balanceAfter = web3.eth.getBalance(account);
return balanceAfter.minus(balanceBefore);
}
module.exports = {
balanceDifference,
};