AssertBalance web3 requirement
eth function requires web3 to querry balalnce.
Use web3 from openzeppelin test environment.
@@ -2,6 +2,7 @@ const BN = require('bn.js')
const chai = require('chai')
const expect = chai.expect
const bnChai = require('bn-chai')
+const {web3} = require("@openzeppelin/test-environment")
chai.use(bnChai(BN))
class AssertBalance {
@@ -16,7 +17,7 @@ class AssertBalance {
async eth(account, amount) {
const balance = await web3.eth.getBalance(account)
- expect(balance).to.equal(amount)
+ expect(balance).to.eq.BN(amount)
}
}
module.exports.AssertBalance = AssertBalance
