install_token_cache
Documentation for eth_defi.testing.token_cache.install_token_cache function.
- install_token_cache(worker_id='master')
Install the shipped token cache as the default for vaults in this session.
Copies
TOKEN_CACHE_SEED_PATHto a private per-worker working file (so concurrentpytest-xdistworkers never contend on one SQLite file and the committed seed is never mutated in place), opens it as aTokenDiskCache, and pointseth_defi.vault.base.DEFAULT_TOKEN_CACHEat it. Every vault constructed without an explicittoken_cachethen uses the disk cache, which is what enables the address-resolution cache as well as the metadata cache.- Parameters
worker_id (str) –
pytest-xdistworker id, used to keep working files separate.- Returns
The installed cache. When no seed is committed yet this is an empty cache, so a rebuild run can still fill it.
- Return type