feat: use cached artifacts if solc config is almost the same#87
Merged
mattsse merged 2 commits intofoundry-rs:mainfrom Mar 7, 2024
Merged
feat: use cached artifacts if solc config is almost the same#87mattsse merged 2 commits intofoundry-rs:mainfrom
mattsse merged 2 commits intofoundry-rs:mainfrom
Conversation
mattsse
requested changes
Mar 7, 2024
Member
mattsse
left a comment
There was a problem hiding this comment.
this makes a lot of sense,
smol sanity test then this is gtg
Comment on lines
+123
to
+133
| /// Returns true if this output selection is a subset of the other output selection. | ||
| pub fn is_subset_of(&self, other: &Self) -> bool { | ||
| self.0.iter().all(|(file, selection)| { | ||
| other.0.get(file).map_or(false, |other_selection| { | ||
| selection.iter().all(|(contract, outputs)| { | ||
| other_selection.get(contract).map_or(false, |other_outputs| { | ||
| outputs.iter().all(|output| other_outputs.contains(output)) | ||
| }) | ||
| }) | ||
| }) | ||
| }) |
Member
There was a problem hiding this comment.
can we add a sanity test for this?
looks correct though
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the only difference between cached vs current solc config is
outputSelectionwhich is a subset of the cached output selection, then it's safe to use cached artifact.I am currently adding logic to foundry to request only abi output and it would be nice if we could use cached abi where possible.
Impl is pretty ugly, but not sure how to make it better without cloning