Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
fix: don't evict cache entries with no artifacts (#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Mar 15, 2022
1 parent 72e280d commit fac944b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ethers-solc/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ impl SolFilesCache {
let mut files: HashMap<_, _> = files.into_iter().map(|(p, v)| (p, v)).collect();

self.files.retain(|file, entry| {
if entry.artifacts.is_empty() {
// keep entries that didn't emit any artifacts in the first place, such as a
// solidity file that only includes error definitions
return true
}

if let Some(versions) = files.remove(file.as_path()) {
entry.retain_versions(versions);
} else {
Expand Down

0 comments on commit fac944b

Please sign in to comment.