Skip to content

Commit e08ccf1

Browse files
committed
chore: proper generate legacy asm estra output file
1 parent ed3826d commit e08ccf1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

crates/artifacts/solc/src/output_selection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ impl FromStr for EvmOutputSelection {
379379
match s {
380380
"evm" => Ok(Self::All),
381381
"asm" | "evm.assembly" => Ok(Self::Assembly),
382-
"evm.legacyAssembly" => Ok(Self::LegacyAssembly),
382+
"legacyAssembly" | "evm.legacyAssembly" => Ok(Self::LegacyAssembly),
383383
"methodidentifiers" | "evm.methodIdentifiers" | "evm.methodidentifiers" => {
384384
Ok(Self::MethodIdentifiers)
385385
}

crates/compilers/src/artifact_output/configurable.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,8 +751,8 @@ impl ExtraOutputFiles {
751751
) -> Result<(), SolcError> {
752752
if self.legacy_assembly {
753753
if let Some(legacy_asm) = asm {
754-
let file = file.with_extension("legacyAssembly");
755-
fs::write(&file, legacy_asm.as_str().unwrap_or_default())
754+
let file = file.with_extension("legacyAssembly.json");
755+
fs::write(&file, format!("{legacy_asm}"))
756756
.map_err(|err| SolcError::io(err, file))?
757757
}
758758
}
@@ -824,6 +824,7 @@ impl ExtraOutputFiles {
824824

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

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

0 commit comments

Comments
 (0)