diff --git a/ethers-solc/src/artifacts/mod.rs b/ethers-solc/src/artifacts/mod.rs index 14300a7f..b7de8151 100644 --- a/ethers-solc/src/artifacts/mod.rs +++ b/ethers-solc/src/artifacts/mod.rs @@ -582,13 +582,16 @@ pub struct Output { #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct SolcAbi { + #[serde(default, skip_serializing_if = "Vec::is_empty")] pub inputs: Vec, #[serde(rename = "stateMutability")] pub state_mutability: Option, #[serde(rename = "type")] pub abi_type: String, + #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, - pub outputs: Option>, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub outputs: Vec, } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] @@ -1377,7 +1380,7 @@ pub struct UserDoc { #[serde(default, skip_serializing_if = "Option::is_none")] pub kind: Option, #[serde(default, skip_serializing_if = "::std::collections::BTreeMap::is_empty")] - pub methods: BTreeMap, + pub methods: BTreeMap>, #[serde(default, skip_serializing_if = "Option::is_none")] pub notice: Option, } @@ -1395,11 +1398,21 @@ pub struct DevDoc { #[serde(default, rename = "custom:experimental", skip_serializing_if = "Option::is_none")] pub custom_experimental: Option, #[serde(default, skip_serializing_if = "::std::collections::BTreeMap::is_empty")] - pub methods: BTreeMap, + pub methods: BTreeMap, #[serde(default, skip_serializing_if = "Option::is_none")] pub title: Option, } +#[derive(Clone, Debug, Default, Serialize, Deserialize, Eq, PartialEq)] +pub struct MethodDoc { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub details: Option, + #[serde(default, skip_serializing_if = "::std::collections::BTreeMap::is_empty")] + pub params: BTreeMap, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub r#return: Option, +} + #[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] #[serde(rename_all = "camelCase")] pub struct Evm { diff --git a/ethers-solc/test-data/yul-sample/SimpleStore.yul b/ethers-solc/test-data/yul-sample/SimpleStore.yul index 4226605b..248e46fe 100644 --- a/ethers-solc/test-data/yul-sample/SimpleStore.yul +++ b/ethers-solc/test-data/yul-sample/SimpleStore.yul @@ -7,5 +7,4 @@ object "SimpleStore" { code { calldatacopy(0, 0, 36) // write calldata to memory } - } -} \ No newline at end of file + }} diff --git a/ethers-solc/tests/project.rs b/ethers-solc/tests/project.rs index f2985684..15a61b98 100644 --- a/ethers-solc/tests/project.rs +++ b/ethers-solc/tests/project.rs @@ -116,8 +116,6 @@ fn can_compile_yul_sample() { std::fs::remove_dir_all(&project.paths().artifacts).unwrap(); let compiled = project.compile().unwrap(); // Make sure ABI does exist - - assert!(compiled.find("Dapp").is_some()); assert!(compiled.find("SimpleStore").is_some()); assert!(!compiled.is_unchanged());