foundry-rs / foundry-fork-db

Apache License 2.0
33 stars 9 forks source link

Add flush to arbitrary file #12

Closed Ethanol48 closed 3 months ago

Ethanol48 commented 3 months ago

Motivation

In issue #6 was discussed of adding public functions to change state in the db, and because of this I think it makes sense to have a way to have a cache file without the need to set it in the db #11 , or in the case that we want to preserve the cache from the previous session without being altered.

Solution

Added in flush_to(cache_path) JsonBlockCacheDB implementation a function that lets you dump the db in a determined file.

Ethanol48 commented 3 months ago

Added minimal documentation.

Ethanol48 commented 3 months ago

Pending changing to CHANGELOG.md

Ethanol48 commented 3 months ago

I’m sorry for any notifications sent, I was using my phone and the application doesn’t have much support and made some mistakes, my apologies.

Ethanol48 commented 3 months ago

Done 👍🏼