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

Commit

Permalink
fix: set metadata file extension properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Feb 16, 2022
1 parent c090a98 commit c86439e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions ethers-solc/src/artifact_output/configurable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ impl ConfigurableArtifacts {
if self.additional_values.ir {
selection.push(ContractOutputSelection::Ir);
}
if self.additional_values.ir_optimized {
if self.additional_values.ir_optimized || self.additional_files.ir_optimized {
selection.push(ContractOutputSelection::IrOptimized);
}
if self.additional_values.metadata {
if self.additional_values.metadata || self.additional_files.metadata {
selection.push(ContractOutputSelection::Metadata);
}
if self.additional_values.storage_layout {
Expand All @@ -163,10 +163,10 @@ impl ConfigurableArtifacts {
if self.additional_values.gas_estimates {
selection.push(EvmOutputSelection::GasEstimates.into());
}
if self.additional_values.assembly {
if self.additional_values.assembly || self.additional_files.assembly {
selection.push(EvmOutputSelection::Assembly.into());
}
if self.additional_values.ewasm {
if self.additional_values.ewasm || self.additional_files.ewasm {
selection.push(EwasmOutputSelection::All.into());
}
selection
Expand Down Expand Up @@ -444,7 +444,7 @@ impl ExtraOutputFiles {
pub fn write_extras(&self, contract: &Contract, file: &Path) -> Result<(), SolcError> {
if self.metadata {
if let Some(ref metadata) = contract.metadata {
let file = file.join(".metadata.json");
let file = file.with_extension("metadata.json");
fs::write(&file, serde_json::to_string_pretty(metadata)?)
.map_err(|err| SolcError::io(err, file))?
}
Expand Down
2 changes: 1 addition & 1 deletion ethers-solc/src/artifacts/output_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl FromStr for EvmOutputSelection {
"evm" => Ok(EvmOutputSelection::All),
"asm" | "evm.assembly" => Ok(EvmOutputSelection::Assembly),
"evm.legacyAssembly" => Ok(EvmOutputSelection::LegacyAssembly),
"hashes" | "methodidentifiers" | "evm.methodIdentifiers" | "evm.methodidentifiers" => {
"methodidentifiers" | "evm.methodIdentifiers" | "evm.methodidentifiers" => {
Ok(EvmOutputSelection::MethodIdentifiers)
}
"gas" | "evm.gasEstimates" | "evm.gasestimates" => Ok(EvmOutputSelection::GasEstimates),
Expand Down

0 comments on commit c86439e

Please sign in to comment.