chore(etherscan): add set cache helper (#1589)

This commit is contained in:
Matthias Seitz 2022-08-12 01:43:46 +02:00 committed by GitHub
parent 1038349510
commit 8105d8be9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -117,6 +117,12 @@ impl Client {
Self::new(chain, api_key)
}
/// Sets the root to the cache dir and the ttl to use
pub fn set_cache(&mut self, root: impl Into<PathBuf>, ttl: Duration) -> &mut Self {
self.cache = Some(Cache { root: root.into(), ttl });
self
}
pub fn etherscan_api_url(&self) -> &Url {
&self.etherscan_api_url
}