I am using truffle, but that shouldn't make any difference here...
When using contract's transfer mehtod, I want to pass a parameter - 1000000000000000000000000, but since this is too big, it results in an error. That's why I pass web3.utils.toBN('1000000000000000000000000')
After that, I should check if one of the address in solidity holds this amount of tokens.
So I have this:
let balance = await instance.balanceOf(address);
This returns a bigNumber.
Way 1: To get an actual number so that I can test if it worked, I tried this: balance.toNumber()
which didn't work.
Way 2: Then, I tried assert.equal(balance, web3.utils.toBN('1000000000000000000000000'));
, but now, it shows an error - AssertionError: expected <BN: d3c21bcecceda1000000> to equal <BN: d3c21bcecceda1000000>
even though they still seem equal.
My question would be what way do you choose to work with such cases ? Way 1 or Way 2? and if so, how do I fix my issue then ? Thanks..