-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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. |
cgewecke
left a comment
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
ryanio
left a comment
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
_txInputFormatterextended with hex prefix check. I've kept theisHexutility 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
0xprefix if not existing instead of throwing anError. This will improve the consistency of the sentdataproperty foreth_callandeth_sendTransactionas well just without breaking something. @cgeweckeFixes #1082
Type of change
Checklist:
npm run dtslintwith success and extended the tests and types if necessary.npm run test:unitwith success and extended the tests if necessary.npm run build-alland tested the resulting file/'s fromdistfolder in a browser.CHANGELOG.mdfile in the root folder.