Added explicity pify dep, deprecating web3.eth. (#1532)

* Added explicity pify dep, deprecating web3.eth.

* Dropped promisify in favor of pify.
This commit is contained in:
Nicolás Venturo
2018-12-03 19:15:30 -03:00
committed by GitHub
parent 41c540fb1e
commit b7d56d5471
6 changed files with 71 additions and 10 deletions

View File

@ -1,7 +1,9 @@
const { ethGetBalance } = require('./web3');
async function balanceDifference (account, promiseFunc) {
const balanceBefore = web3.eth.getBalance(account);
const balanceBefore = await ethGetBalance(account);
await promiseFunc();
const balanceAfter = web3.eth.getBalance(account);
const balanceAfter = await ethGetBalance(account);
return balanceAfter.minus(balanceBefore);
}