Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cast arguments for new Bignumbers() to string. #5060

Merged
merged 1 commit into from
Aug 14, 2018
Merged

Conversation

danjm
Copy link
Contributor

@danjm danjm commented Aug 14, 2018

Due an unexpected issue in our current version of bignumber.js (MikeMcl/bignumber.js#148), new Bignumber(x) where x's significant digits were greater than 15 and x is not a string were throwing an error.

It seems that all our instances of new Bignumber(x) that were getting hit by numbers with that many significant digits were already casting args to strings, except for the new approve screen.

This PR updates all cases of new Bignumber(x) where x was not being converted to a string.

For a before and after test. Before:

  • Run the app on develop, switch to mainnet and go to https://dai.makerdao.com/
  • Click the 'Denied' toggle next to MKRWipe/Shut on the right side of the screen
  • try to customize gas
  • Gas will not update. check the console to see bignumber errors like that linked above

After:

  • Run the app on this PRs branch and then follow the above steps
  • Gas should correctly update
  • submit the transaction (you can approve 0 MKR)
  • the transaction should successfully confirm

@danjm danjm requested review from alextsg and whymarrh as code owners August 14, 2018 03:20
alextsg
alextsg previously approved these changes Aug 14, 2018
Copy link
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the more explicit String(value) instead of the implicit string conversion?

Copy link
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@danfinlay danfinlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@danfinlay danfinlay merged commit d7aa1bf into develop Aug 14, 2018
@danfinlay danfinlay deleted the bignumber-string branch August 14, 2018 21:36
@tmashuang tmashuang restored the bignumber-string branch August 14, 2018 21:47
@whymarrh whymarrh deleted the bignumber-string branch August 15, 2018 14:51
@tmashuang tmashuang mentioned this pull request Aug 15, 2018
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.

4 participants