banteg / multicall.py

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

Utilizing `[async_]simple_cache_middleware` to remove chainids mapping #63

Open DefiDebauchery opened 1 year ago

DefiDebauchery commented 1 year ago

Building off of #62, one thing that web3py supports in both sync and async versions is the caching of chainids by using the simple_cache_middleware.

Would it be an overreach to modify the default middlewares in utils.py and remove the internal mapping, where users will simply have to ensure they're using it (unless we want to check in utils and add it in a similar fashion as ClientTimeout)?

BobTheBuidler commented 1 year ago

How far back does this support go? I like that multicall is able to work with some older versions of web3 as well and would prefer to keep that wide of a range if we can.

You can go ahead and implement this so long as we're able to maintain support for all currently supported web3 versions.

BobTheBuidler commented 1 year ago

It does seem a bit unnecessary imo but if you throw it together I'll take a look and merge it in if it works as we want