fix(solc): emit empty vec for empty artifacts (#1345)
This commit is contained in:
parent
1dfe6d0cd2
commit
85a572c9f6
|
@ -337,6 +337,7 @@ impl ArtifactOutput for ConfigurableArtifacts {
|
|||
file: &VersionedSourceFile,
|
||||
) -> Option<Self::Artifact> {
|
||||
file.source_file.ast.clone().map(|ast| ConfigurableContractArtifact {
|
||||
abi: Some(LosslessAbi::default()),
|
||||
id: Some(file.source_file.id),
|
||||
ast: Some(ast),
|
||||
bytecode: Some(CompactBytecode::empty()),
|
||||
|
|
|
@ -1318,7 +1318,7 @@ impl OutputContracts {
|
|||
/// ethabi as it would require a redesign of the overall `Param` and `ParamType` types. Instead,
|
||||
/// this type keeps a copy of the [`serde_json::Value`] when deserialized from the `solc` json
|
||||
/// compiler output and uses it to serialize the `abi` without loss.
|
||||
#[derive(Clone, Debug, PartialEq, Default)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct LosslessAbi {
|
||||
/// The complete abi as json value
|
||||
pub abi_value: serde_json::Value,
|
||||
|
@ -1326,6 +1326,12 @@ pub struct LosslessAbi {
|
|||
pub abi: Abi,
|
||||
}
|
||||
|
||||
impl Default for LosslessAbi {
|
||||
fn default() -> Self {
|
||||
LosslessAbi { abi_value: serde_json::json!([]), abi: Default::default() }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<LosslessAbi> for Abi {
|
||||
fn from(abi: LosslessAbi) -> Self {
|
||||
abi.abi
|
||||
|
|
Loading…
Reference in New Issue