-
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
Extend _txInputFormatter
with hex prefix check
#3317
Conversation
@cgewecke As our test does bring up would this be a breaking change for Ganache. The more strict validation which does require any hex string to be prefixed with the known hex prefix '0x' does throw an error in many cases. This means we are probably forced to wait with a more strict validation of hex strings until 2.0. WDYT? |
@nivida Yes, agree it looks that way to me as well. It's too bad. Ganache has 7 failing tests. The original comment at the reporting issue says:
which means some people are probably passing the raw solc bytecode output directly to Geth too. |
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.
@nivida It looks like were forced to put the Hold label on this for the time being.
… data property of eth_call oder eth_sendTransaction
@ryanio This could get merged because it is backward compatible. web3.js will send anything with a |
@nivida ah just coming across your comment, sorry I missed it when you first posted it. ok thanks we will include this in the next release. |
_txInputFormatter
with hex prefix check
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.
LGTM!
Description
_txInputFormatter
extended with hex prefix check. I've kept theisHex
utility function as it is because it is a part of the public API and would probably introduce a breaking change for some.Edit:
I've changed the implementation to prepend the
0x
prefix if not existing instead of throwing anError
. This will improve the consistency of the sentdata
property foreth_call
andeth_sendTransaction
as well just without breaking something. @cgeweckeFixes #1082
Type of change
Checklist:
npm run dtslint
with success and extended the tests and types if necessary.npm run test:unit
with success and extended the tests if necessary.npm run build-all
and tested the resulting file/'s fromdist
folder in a browser.CHANGELOG.md
file in the root folder.