Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
fix(solc): use correct types (#1004)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Mar 10, 2022
1 parent e1d66b8 commit 1b1cde0
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions ethers-solc/src/artifacts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item>,
#[serde(rename = "stateMutability")]
pub state_mutability: Option<String>,
#[serde(rename = "type")]
pub abi_type: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
pub outputs: Option<Vec<Item>>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub outputs: Vec<Item>,
}

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
Expand Down Expand Up @@ -1377,7 +1380,7 @@ pub struct UserDoc {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
#[serde(default, skip_serializing_if = "::std::collections::BTreeMap::is_empty")]
pub methods: BTreeMap<String, String>,
pub methods: BTreeMap<String, BTreeMap<String, String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub notice: Option<String>,
}
Expand All @@ -1395,11 +1398,21 @@ pub struct DevDoc {
#[serde(default, rename = "custom:experimental", skip_serializing_if = "Option::is_none")]
pub custom_experimental: Option<String>,
#[serde(default, skip_serializing_if = "::std::collections::BTreeMap::is_empty")]
pub methods: BTreeMap<String, serde_json::Value>,
pub methods: BTreeMap<String, MethodDoc>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
}

#[derive(Clone, Debug, Default, Serialize, Deserialize, Eq, PartialEq)]
pub struct MethodDoc {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub details: Option<String>,
#[serde(default, skip_serializing_if = "::std::collections::BTreeMap::is_empty")]
pub params: BTreeMap<String, String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#return: Option<String>,
}

#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Evm {
Expand Down

0 comments on commit 1b1cde0

Please sign in to comment.