Skip to content

Commit

Permalink
chore: proper generate legacy asm estra output file
Browse files Browse the repository at this point in the history
  • Loading branch information
grandizzy committed Sep 30, 2024
1 parent ed3826d commit e08ccf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/artifacts/solc/src/output_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl FromStr for EvmOutputSelection {
match s {
"evm" => Ok(Self::All),
"asm" | "evm.assembly" => Ok(Self::Assembly),
"evm.legacyAssembly" => Ok(Self::LegacyAssembly),
"legacyAssembly" | "evm.legacyAssembly" => Ok(Self::LegacyAssembly),
"methodidentifiers" | "evm.methodIdentifiers" | "evm.methodidentifiers" => {
Ok(Self::MethodIdentifiers)
}
Expand Down
5 changes: 3 additions & 2 deletions crates/compilers/src/artifact_output/configurable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,8 @@ impl ExtraOutputFiles {
) -> Result<(), SolcError> {
if self.legacy_assembly {
if let Some(legacy_asm) = asm {
let file = file.with_extension("legacyAssembly");
fs::write(&file, legacy_asm.as_str().unwrap_or_default())
let file = file.with_extension("legacyAssembly.json");
fs::write(&file, format!("{legacy_asm}"))
.map_err(|err| SolcError::io(err, file))?
}
}
Expand Down Expand Up @@ -824,6 +824,7 @@ impl ExtraOutputFiles {

let evm = contract.evm.as_ref();
self.process_assembly(evm.and_then(|evm| evm.assembly.as_deref()), file)?;
self.process_legacy_assembly(evm.and_then(|evm| evm.legacy_assembly.clone()), file)?;

let bytecode = evm.and_then(|evm| evm.bytecode.as_ref());
self.process_generated_sources(bytecode.map(|b| &b.generated_sources), file)?;
Expand Down

0 comments on commit e08ccf1

Please sign in to comment.