Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: create and use disk-cache utilities for contracts-cache items #2416

Merged
merged 5 commits into from
Dec 16, 2024

Conversation

antazoey
Copy link
Member

What I did

OK This is a big refactor for the contract-type caching related code. Nothing is breaking but there is a lot more public stuff added. This makes thing way easier to use both for us and for users. We can no more easily improve the caching features, which is what I was trying to do for 0.9.

How I did it

Make a base model for writing and reading from Disk
Make some stuff to help the deployments JSON patrick added a while back.
Incorporate this stuff into the caches for chain.contracts, deleting lots of repetitious code along the way.
Move contract caching stuff to its own module for faster loading.
The list goes on!

How to verify it

looking for everything working pretty much as it did, except there are some new toolings and methods as well, which is now used all over our tests.

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@antazoey antazoey force-pushed the feat/disk-cachable-models branch from 07027d9 to 2080314 Compare December 14, 2024 00:27
class CacheDirectory:
"""
A directory for caching data where each data item is named
``<key>.json`` and is in the directory. You can access the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this have some prefix like cache_<key>.json?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe, or all in /caches sub-folder but i dont want to change the structure now as it will be too breaking

@antazoey antazoey merged commit 9dc7098 into ApeWorX:main Dec 16, 2024
18 checks passed
@antazoey antazoey deleted the feat/disk-cachable-models branch December 16, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants