-
Notifications
You must be signed in to change notification settings - Fork 765
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
from-rpc does not convert difficulty right if difficulty is a number #726
Comments
This seems to have to do with types, we should either enforce that users only input Buffers/hex strings or we should manually convert numbers to hex strings if that's the case. (It seems like ethereumjs-util will convert them to Buffers). I think we should do the latter, we can check if something is a number and then convert it to a hex string. |
Right now on the latest web3 version and on return values of
In general, maybe strings which are not 0x-prefixed should be assumed as decimal number strings and thus treated as such? Also adding TX here since TX throws the errors regarding gasPrice and value. |
Is this still an issue? |
Yes this is still an issue. Should be easy to fix though. |
Hello! I am a new contributor and am looking forward to working with the developer community. I have opened PR #1254 to begin addressing this issue. Please let me know if you have any ideas on how to improve the approach I took to checking and converting the |
@jochem-brouwer Passing a JSON object that has a difficulty parameter of type decimal string throws an error in block:
Here is the JSON object that resulted in the error, for reference:
|
Fixed with #1316 |
Geth's web3.eth.getBlock returns difficulty as a number. One has to manually convert this to hex before feeding it to from-rpc.
If you feed these to blockchain you get an Invalid difficulty error.
The text was updated successfully, but these errors were encountered: