-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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.eth.getBlock() returns baseFeePerGas field as hex string instead of BN or number #4326
Comments
This is a simple fix, however I'm slightly concerned being that this is technically a breaking change |
@spacesailor24 Once you have the PR, can we connect it and discuss as mentioned in today's call? Thanks. cc: @jdevcs to follow up on best way forward due to potential breaking change. |
Related to this issue, in Typescript you can't access
As a quick fix I just added that property here and I just wanted you to be aware. |
This breaking change is being pushed to the next release (1.5.4) to not interfere with the already released 1.5.3-rc0. |
* Add BigNumber formatter to baseFeePerGas in returned blocks * Update CHANGELOG * Update docs for getBlcok * Add baseFeePerGas to example output * Update formatting of baseFeePerGas to number * Add baseFeePerGas to BlockHeader type
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
Not stale, unless it's already done and wasn't properly closed. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
Not stale, unless it's already done and wasn't properly closed. |
What is the returned unit for baseFeePerGas? Is it wei or Gwei? |
Wei |
`node --experimental-repl-await
)
` |
Expected behavior
The field should be a
BN
, anumber
, or possibly a (decimal) numeric string.Actual behavior
The field is a hexadecimal string.
Steps to reproduce the behavior
Start a private blockchain with Geth, using
geth --dev --http
. In a location where web3 is installed, runnode --experimental-repl-await
to open a Node console. Do:You will see that the
baseFeePerGas
field is returned as a hexadecimal string rather than any of the possibilities above.Logs
Environment
Geth: 1.10.6-stable-576681f2
Web3.js: 1.5.2
Npm: 6.14.11
Node.js: v12.21.0
The text was updated successfully, but these errors were encountered: