banteg / multicall.py

aggregate results of multiple smart contract calls into one
MIT License
246 stars 106 forks source link

Access block number from the result dictionary #39

Closed prabhatverma286 closed 4 months ago

prabhatverma286 commented 2 years ago

Looks like multicall returns the blockNumber during aggregate (or tryBlockAndAggregate) calls.

However, it is omitted from the results dictionary: https://github.com/banteg/multicall.py/blob/master/multicall/multicall.py#L86

In cases where per-block data needs to be accessed and stored, it would be beneficial to know the block number on which the multicall request was performed on, saving the user from doing a separate web3.eth.block_number request just after the multicall request.

Maybe the block number can be returned as '_block_number' in the results dictionary.

BobTheBuidler commented 4 months ago

closing this issue as we merged a similar feature a while back ^