diff --git a/ethers-solc/src/artifact_output.rs b/ethers-solc/src/artifact_output.rs index 899f6c0e..d307050d 100644 --- a/ethers-solc/src/artifact_output.rs +++ b/ethers-solc/src/artifact_output.rs @@ -565,3 +565,16 @@ impl ArtifactOutput for MinimalCombinedArtifactsHardhatFallback { MinimalCombinedArtifacts::contract_to_artifact(file, name, contract) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn is_artifact() { + fn assert_artifact() {} + + assert_artifact::(); + assert_artifact::(); + } +} diff --git a/ethers-solc/src/artifacts.rs b/ethers-solc/src/artifacts.rs index 77f17437..1c500a68 100644 --- a/ethers-solc/src/artifacts.rs +++ b/ethers-solc/src/artifacts.rs @@ -801,7 +801,7 @@ impl From for ContractBytecode { /// /// Unlike `CompactContractSome` which contains the `BytecodeObject`, this holds the whole /// `Bytecode` object. -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq)] pub struct CompactContractBytecode { /// The Ethereum Contract ABI. If empty, it is represented as an empty /// array. See https://docs.soliditylang.org/en/develop/abi-spec.html @@ -1002,6 +1002,12 @@ impl From for CompactContract { } } +impl From for CompactContractBytecode { + fn from(val: serde_json::Value) -> Self { + serde_json::from_value(val).unwrap_or_default() + } +} + impl From for CompactContract { fn from(c: ContractBytecode) -> Self { let ContractBytecode { abi, bytecode, deployed_bytecode } = c;