Skip to content

Conversation

@nicholaspai
Copy link

Description

First of all, thank you for building this package in the first place, it is really awesome! 💯

I ran into this error when using the MetaMask provider and calling web3.eth.getBalanceOf(address) on an account with a lot of ETH. I seed all of my GanacheCLI accounts with 10,000 ETH so I ran into this error easily. I encountered BigNumber conversion errors, complaining that I was trying to convert a scientific-notation number, for example "9.988e+22", into a BN. I added a fix to detect if result is a number in scientific notation and to subsequently convert it.

Specific edits:

  • Created a file to convert between exponential/scientific notation and numbers
  • Checked whether result in send() is in scientific notation, which is possible I believe because nodeJS sometimes automatically converts numbers >= 1e21 into scientific notation. See more here
  • To replicate the error, call web3.eth.getBalanceOf(address) on an address with a lot of ETH.

Other Changes

Checklist

Scripts

Added Scripts:

Updated Scripts:

Dependencies

Added Dependencies:

Updated Dependencies:

Related Issues

Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
@CLAassistant
Copy link

CLAassistant commented Mar 5, 2020

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants