-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Unexpected behaviour using web3.utils.toHex function #2775
Comments
Thanks for opening this issue! But I will close this issue because there are already several similar open issues with the bug or enhancement label. The current discussion about the BigInt handling in Web3.js is here. Edit: Btw.: The latest version is beta.54. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm using toHex function from web3@1.0.0-beta.33 "utils" and facing strange behaviour regarding where this function is executed. When the function is running in localhost, everything is working as expected, hex value is right because I am getting the right number out of it, but the problem occurs when DApp is deployed in production, more specifically on Amazon's S3 Bucket. There I am getting completely different hex value, which is not correct. So I will post here statement which I tested in Chrome's console, both in localhost and production environment and respectfully their results(both in hex and decimal number). Not sure if it's a web3 bug, but I'm just trying to figure out what happens here. I'll be thankful for any feedback.
Expected behavior
To get the same result both in localhost and production when web3.utils.toHex.
For the code provided down below:
Localhost:
0xf0503bbcf59aa40000 ---> Integer value: 4.433e+21
Production:
0xf0503bbcf59aa40000 ---> Integer value: 4.433e+21
Actual behavior
Getting different results in localhost and production.
For code provided down below:
Localhost:
0xf0503bbcf59aa40000 ---> Integer value: 4.433e+21
Production:
0x2266303530336262636635396161343030303022 ---> 1.9638456170702058e+47
Steps to reproduce the behavior
Versions
The text was updated successfully, but these errors were encountered: