You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In eth.go, and a some other places (including the new TipSetResolver introduced in #12762), we parse these types of eth strings - they can be one of the pre-defined values or a block hash or a block number. The problem is that we have inconsistent handling of them. Sometimes we just take the string and switch it and other times we explicitly json-decode it using EthBlockNumberOrHash.
We should:
Make internal methods that take these strings take a EthBlockNumberOrHash instead
Make our external API methods that currently take a string immediately have to convert it to a EthBlockNumberOrHash before using it
Each method that takes one, should additionally validate that it's within bounds of what it can deal with: sometimes it's not allowed to take certain forms, we should assert that on the EthBlockNumberOrHash that we get back, perhaps add validation methods to EthBlockNumberOrHash itself for common cases. e.g. "earliest" is parsed by some functions and immediately errors, maybe we should handle that?
Needs a little bit of research into the various ETH APIs we support and what go-ethereum (and friends) allows in the various calls.
The text was updated successfully, but these errors were encountered:
In eth.go, and a some other places (including the new
TipSetResolver
introduced in #12762), we parse these types of eth strings - they can be one of the pre-defined values or a block hash or a block number. The problem is that we have inconsistent handling of them. Sometimes we just take the string andswitch
it and other times we explicitly json-decode it usingEthBlockNumberOrHash
.We should:
EthBlockNumberOrHash
insteadstring
immediately have to convert it to aEthBlockNumberOrHash
before using itEthBlockNumberOrHash
that we get back, perhaps add validation methods toEthBlockNumberOrHash
itself for common cases. e.g."earliest"
is parsed by some functions and immediately errors, maybe we should handle that?Needs a little bit of research into the various ETH APIs we support and what go-ethereum (and friends) allows in the various calls.
The text was updated successfully, but these errors were encountered: