Skip to content

Commit

Permalink
helper for OutputSelection (#89)
Browse files Browse the repository at this point in the history
Ref
foundry-rs/foundry#7334 (comment)

with that helper it will be
`OutputSelection::common_output_selection(["abi".to_string()])`
  • Loading branch information
klkvr authored Mar 10, 2024
1 parent 938e417 commit 7f670d5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/artifacts/output_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ impl OutputSelection {
)])
}

/// Returns output selection configuration which enables the same provided outputs for each
/// contract of each source.
pub fn common_output_selection(outputs: impl IntoIterator<Item = String>) -> Self {
BTreeMap::from([(
"*".to_string(),
BTreeMap::from([("*".to_string(), outputs.into_iter().collect())]),
)])
.into()
}

/// Returns an empty output selection which corresponds to an empty map `{}`
pub fn empty_file_output_select() -> FileOutputSelection {
Default::default()
Expand Down

0 comments on commit 7f670d5

Please sign in to comment.