Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
57 views

How to assert that a BigNumber is included in a list of numbers?

I am trying to assert a uint256 the following way: expect(tokenType).to.be.oneOf([1, 2, 3, 4]); I just want to check that its value is any of the ones on that list, as I am using a ...
Falcon Stakepool's user avatar
2 votes
1 answer
311 views

AssertionError: expected BigNumber { value: "0" } to equal BigNumber { value: "0" }

I have created two basic ERC20 tokens (TokenA and TokenB) and a contract that swaps TokenA with TokenB. Everything seems working but I get the error above when I run the test file. How can BigNumber { ...
Claudio's user avatar
  • 35
2 votes
1 answer
2k views

Comparing ethers BigNumber does not work

I'm testing the value of a BigNumber returned from a function call to a contract and its not working as expected. I have this const { BigNumber } = require('ethers'); ... const totalSupply = await ...
Inn0vative1's user avatar
3 votes
2 answers
2k views

Convert big number to number on hardhat tests

Sorry for the newbie question. There are a lot of solutions but non of them worked for me. I am getting an account's balance with const balance_before = await ethers.provider.getBalance(redeemer....
MehmedB's user avatar
  • 240