diff --git a/test/helpers/balanceDiff.js b/test/helpers/balanceDiff.js new file mode 100644 index 000000000..8f88ba400 --- /dev/null +++ b/test/helpers/balanceDiff.js @@ -0,0 +1,10 @@ +async function balanceDifference (account, promise) { + const balanceBefore = web3.eth.getBalance(account); + await promise(); + const balanceAfter = web3.eth.getBalance(account); + return balanceAfter.minus(balanceBefore); +} + +module.exports = { + balanceDifference, +};