-
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
Integer overflow fixed in formatters #3234
Conversation
…ct. The eth.estimateGas return value is now handled as BigInt and I've updated related tests
…updated to accept the same types as anywhere else for the block parameter
…timestamps as well
…iseconds as I thought
…matter and tests fixed
…ormatter for consistency reasons
@cgewecke As mentioned in issue #3227 are the max. values defined in EIP-1985 bigger than the That’s why I think adding a Example: {
numbers: 'default' | 'string' | 'BN' | Function
} I've added |
@nivida I kind of like the interface proposed in this comment at 3227 and think To me it seems like there are many different clients who are either returning large values for a specific field (like On the client side, EIP-1985 is less important than it seems because
My instinct is to look at this question (on 1.x anyway) more from a practical standpoint and worry less about conforming to the clients' formal specification. @nivida What is you opinion of providing the ability to specify the format of number outputs as a separate extension lib published to the web3-js org? |
Yes, the
I think this will confuse our customers more than necessary. I would add such a configuration property with four options or we close this PR and do provide this possibility in a clean way for 2.x
Yes, this is something we wouldn’t provide. The idea I had was to return all numbers on all places as string, BN, the current mixed types, or whatever the coerce function is returning. This would be a global setting applied to all numbers to improve the current situation for a lot of custom Ethereum chains. After all: |
Yeah, I don't think an extension lib is ideal either. And it seems like people will want it to be configurable?
Yes, absolutely! We can always come back to this and there are several good solutions... |
I've closed this PR now and we can later re-open it again if required. |
Description
Fixes #3227 & #1905
Affected Methods:
getBlockNumber
:web3-eth
getPastLogs
:web3-eth
isSyncing
:web3-eth
sendTransaction
:web3-eth
getBlock
:web3-eth
getUncle
:web3-eth
getTransaction
:web3-eth
getTransactionFromBlock
:web3-eth
getTransactionReceipt
:web3-eth
estimateGas
:web3-eth
getPastLogs
:web3-eth
getTransactionCount
:web3-eth
subscribe('newBlockHeaders')
:web3-eth
subscribe('logs')
:web3-eth
subscribe('syncing')
:web3-eth
contract-events
:web3-eth-contract
contract-methods
:web3-eth-contract
getPastEvents
:web3-eth-contract
Affected Interfaces
Type of change
Checklist:
npm run test
with success and extended the tests if necessary.npm run build
and tested the resulting file fromdist
folder in a browser.