-
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
web3.utils.padRight cannot pad hex strings that begin with 0x8 or higher #7182
Comments
Hi @eyqs |
The issue seems to stem from the way In your specific case, the string Here’s how you can troubleshoot and potentially resolve this issue:
If the problem persists, providing more details on the context or the environment where this issue occurs could help in diagnosing the problem further. I hope this helps. |
For context, this shows up when calling web3.soliditySha3. It eventually calls solidityPack which tries calling |
Expected behavior
web3.utils.padRight('0x05e2e7de3cd95eb48fa9ff77e7860cf249fe05f726abea45a0a44e62b4bf52b2', 64)
should return0x05e2e7de3cd95eb48fa9ff77e7860cf249fe05f726abea45a0a44e62b4bf52b2
.web3.utils.padRight('0xb5e2e7de3cd95eb48fa9ff77e7860cf249fe05f726abea45a0a44e62b4bf52b2', 64)
should return0xb5e2e7de3cd95eb48fa9ff77e7860cf249fe05f726abea45a0a44e62b4bf52b2
.Actual behavior
web3.utils.padRight('0x05e2e7de3cd95eb48fa9ff77e7860cf249fe05f726abea45a0a44e62b4bf52b2', 64)
returns0x05e2e7de3cd95eb48fa9ff77e7860cf249fe05f726abea45a0a44e62b4bf52b2
.web3.utils.padRight('0xb5e2e7de3cd95eb48fa9ff77e7860cf249fe05f726abea45a0a44e62b4bf52b2', 64)
throws an exception:Steps to reproduce the behavior
Call the functions above.
Logs
Environment
The text was updated successfully, but these errors were encountered: