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

Commit

Permalink
add fn settings on CompilerInput (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshieDo authored Dec 23, 2021
1 parent 07e13ab commit ade8cd9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ethers-solc/src/artifacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ impl CompilerInput {
Self { language: "Solidity".to_string(), sources, settings: Default::default() }
}

/// Sets the settings for compilation
#[must_use]
pub fn settings(mut self, settings: Settings) -> Self {
self.settings = settings;
self
}

/// Sets the EVM version for compilation
#[must_use]
pub fn evm_version(mut self, version: EvmVersion) -> Self {
Expand Down
3 changes: 2 additions & 1 deletion ethers-solc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ impl<Artifacts: ArtifactOutput> Project<Artifacts> {
paths.extend(map);

let input = CompilerInput::with_sources(sources)
.settings(self.solc_config.settings.clone())
.normalize_evm_version(&solc.version()?)
.with_remappings(self.paths.remappings.clone());

Expand Down Expand Up @@ -397,7 +398,7 @@ impl<Artifacts: ArtifactOutput> Project<Artifacts> {
let sources = paths.set_source_names(sources);

let input = CompilerInput::with_sources(sources)
.evm_version(self.solc_config.settings.evm_version.unwrap_or_default())
.settings(self.solc_config.settings.clone())
.normalize_evm_version(&solc.version()?)
.with_remappings(self.paths.remappings.clone());

Expand Down

0 comments on commit ade8cd9

Please sign in to comment.