chore(etherscan): add set cache helper (#1589)
This commit is contained in:
parent
1038349510
commit
8105d8be9b
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue