eth.rb icon indicating copy to clipboard operation
eth.rb copied to clipboard

Problem with fetching archive data

Open wafcio opened this issue 11 months ago • 2 comments

I want to use eth_call with a custom block number, which should return archive data. Unfortunately, I have found that in line https://github.com/q9f/eth.rb/blob/main/lib/eth/client.rb#L472 "latest" value is added.

Is it possible to put there block number instead of "latest" value?

wafcio avatar Mar 18 '24 01:03 wafcio

yes, this is possible. you can try it out by changing latest to a number of your choice and locally run bin/console and test it out with get_balance.

to make it applicable in general for the library, it requires some metaprogramming though.

maybe we can create a configuration that is set by default to latest but can be overridden by some block number for the entire environment.

open for ideas.

q9f avatar Apr 16 '24 15:04 q9f

@q9f please provide snippet, how to use it

wafcio avatar Apr 16 '24 15:04 wafcio

Fixed in #268

q9f avatar Jul 02 '24 14:07 q9f