-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
getBlockWithTransactions doesn't parse anymore transactions' gasPrice and value into BigNumber #1858
Comments
Yes, I noticed this problem as well after updating. Perhaps 5.4.2 or 5.4.3 is where the root change happened. |
Additionally, transaction |
Investigating this now. It should certainly still be a BigNumber. |
What Provider or backend are you using? |
JsonRpcProvider, OpenEthereum |
The issue is the same with InfuraProvider or JsonRpcProvider connected to geth 1.10.6 |
Thanks! I've verified this is an issue, and am still investigating the root cause. |
I've found the issue and fixed it in 78e4273. Sorry, a typo in the commit message (missing #) prevented the commit from being automatically picked up on this issue. |
This has been fixed in 5.4.5. Please try it out and let me know if you have any more issues. Thanks! :) |
No complaints, so I think this is working. I'll close it now. Let me know if there are any more problems. Thanks! :) |
Describe the bug
Providers::getBlockWithTransactions
should return a Promise of aBlockWithTransaction
which contains an array ofTransactionResponse
, wheregasPrice
andvalue
members areethers.BigNumber
.However, it now returns an hex string which should be parsed via
ethers.BigNumber.from(tx.gasPrice)
.The running behavior does not match the types.
The behavior should be fixed, or the documentation changed to let us know when we manually need to use
ethers.BigNumber.from
and on which members of aTransactionResponse
.Reproduction steps
In the code snippet below,
tx.(gasPrice|value)
andsameTx.(gasPrice|value)
should be bothethers.BigNumber
, buttx.(gasPrice|value)
is a string.Sample output:
Desired output:
Environment:
node.js v14.17.0
ethers.js: 5.4.4
Issue is the same with InfuraProvider or JsonRpcProvider (geth 1.10.6)
Issue is the same whether the TX is version 0 or 2 (EIP 1559).
Search Terms
gasPrice value BigNumber regression
The text was updated successfully, but these errors were encountered: