Files
openzeppelin-contracts/test/helpers/balanceDifference.js
Nicolás Venturo b7d56d5471 Added explicity pify dep, deprecating web3.eth. (#1532)
* Added explicity pify dep, deprecating web3.eth.

* Dropped promisify in favor of pify.
2018-12-03 19:15:30 -03:00

13 lines
324 B
JavaScript

const { ethGetBalance } = require('./web3');
async function balanceDifference (account, promiseFunc) {
const balanceBefore = await ethGetBalance(account);
await promiseFunc();
const balanceAfter = await ethGetBalance(account);
return balanceAfter.minus(balanceBefore);
}
module.exports = {
balanceDifference,
};