INFURA / go-ethlibs

Ethereum libraries in Go for interacting with Ethereum nodes
MIT License
162 stars 34 forks source link

Add eth.Uncle for use in eth_getUncle methods. #12

Closed ryanschneider closed 4 years ago

ryanschneider commented 4 years ago

So, it turns out that the various implementations of the eth_getUncleBy... methods have a ton of inconsistencies between them, enough that trying to shoe horn their results into an eth.Block will almost always fail.

Namely:

So, this PR adds eth.Uncle which should be able to handle these cases without leaking that complexity into eth.Block, which remains unchanged.

I opted not to add UncleByBlockHashAndIndex etc to the node.Client, I think these APIs are uncommon enough that users can be expected to handle them via node.Client.Request.