-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix(#7044): toWei trim strings with more than 20 decimal places #7045
Conversation
fixes #7044 |
let parsedNumber = number; | ||
if (typeof parsedNumber === 'number'){ | ||
if (parsedNumber < 1e-15){ | ||
let parsedNumber: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gordon-to thanks for PR,
due to this change , there are build errors:
Error: web3-utils: src/converters.ts(580,10): error TS2454: Variable 'parsedNumber' is used before being assigned.
Error: web3-utils: src/converters.ts(580,92): error TS24[54](https://github.com/web3/web3.js/actions/runs/9125740835/job/25095746688?pr=7045#step:6:55): Variable 'parsedNumber' is used before being assigned.
884fa09
to
1be5117
Compare
hey there, the PR is failing some of the testcases, in the |
1be5117
to
6b6fe78
Compare
I added more tests and also added a fix for the function |
29626e5
to
46b1acc
Compare
Description
Please include a summary of the changes and be sure to follow our Contribution Guidelines.
Type of change
Checklist:
npm run lint
with success and extended the tests and types if necessary.npm run test:unit
with success.npm run test:coverage
and my test cases cover all the lines and branches of the added code.npm run build
and testeddist/web3.min.js
in a browser.CHANGELOG.md
file in the root folder.