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

@ethersproject/bignumber is strange on invalid input #935

Closed
ChALkeR opened this issue Jul 7, 2020 · 2 comments
Closed

@ethersproject/bignumber is strange on invalid input #935

ChALkeR opened this issue Jul 7, 2020 · 2 comments
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@ChALkeR
Copy link

ChALkeR commented Jul 7, 2020

There appears to be a regex, but it doesn't actually check anything as it's not anchored.

> require('@ethersproject/bignumber').BigNumber.from('0-0x1 whatever')
BigNumber { _hex: '0x0-0x1 whatever', _isBigNumber: true }
@ricmoo ricmoo added investigate Under investigation and may be a bug. on-deck This Enhancement or Bug is currently being worked on. labels Jul 7, 2020
@ricmoo ricmoo added bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. and removed investigate Under investigation and may be a bug. on-deck This Enhancement or Bug is currently being worked on. labels Jul 8, 2020
@ricmoo
Copy link
Member

ricmoo commented Jul 8, 2020

This should be fixed in 5.0.5.

Try it out and let me know. :)

I've also added a bunch of additional test cases for both valid and invalid strings.

@ricmoo
Copy link
Member

ricmoo commented Jul 10, 2020

Closing this now. If you have any problems, please re-open it though.

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants