ethereum / web3.py

A python interface for interacting with the Ethereum blockchain and ecosystem.
http://web3py.readthedocs.io
MIT License
4.89k stars 1.67k forks source link

Allow provider init with cache configuration & add tests #3395

Closed fselmo closed 1 month ago

fselmo commented 1 month ago

What was wrong?

Closes #3394

How was it fixed?

Todo:

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

clover-es commented 1 month ago

Maybe tests test_caching_requests_does_not_share_state_between_providers and test_async_request_caching_does_not_share_state_between_providers should be adapted as well?

I know previously wasn't tested either (probably that was an error), but I think that if the purpose is to test whether cache is shared, they should be initialized with cache_allowed_requests=True.

fselmo commented 1 month ago

I know previously wasn't tested either (probably that was an error), but I think that if the purpose is to test whether cache is shared, they should be initialized with cache_allowed_requests=True.

That is definitely the case, good catch. Will add that in here.


edit: I also added to those tests the case where a cache is shared, as a sanity check and for quicker code readability.