Clean up serde rename and use rename_all = camelCase when possible (#9823)

* Clean up serde rename and use rename_all = camelCase when possible

* snake_case for pricing

* Use camelcase for engine

* Use camel case for seal

* Use camel case for validator set

* Use camel case for confirmation payload

* Use camel case for consensus status

* Use camel case for nodekind

* Use kebab case for provenance

* Use camel case for pubsub

* Use lowercase and camelcase for trace

* Use camel case for whisper

* rename Ethash as irregular name
This commit is contained in:
Wei Tang
2018-10-29 23:49:04 +08:00
committed by GitHub
parent f8f8bf0fea
commit 05be4b5b0e
50 changed files with 140 additions and 311 deletions

View File

@@ -24,7 +24,7 @@ use ethjson::bytes::Bytes;
pub enum Source {
Raw(Cow<'static, String>),
Constructor {
#[serde(rename="constructor")]
#[serde(rename = "constructor")]
source: Cow<'static, String>,
arguments: Bytes,
sender: Address,
@@ -42,13 +42,13 @@ impl Source {
}
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Fixture {
pub caption: Cow<'static, String>,
pub source: Source,
pub address: Option<Address>,
pub sender: Option<Address>,
pub value: Option<Uint>,
#[serde(rename="gasLimit")]
pub gas_limit: Option<u64>,
pub payload: Option<Bytes>,
pub storage: Option<Vec<StorageEntry>>,
@@ -62,12 +62,12 @@ pub struct StorageEntry {
}
#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct CallLocator {
pub sender: Option<Address>,
pub receiver: Option<Address>,
pub value: Option<Uint>,
pub data: Option<Bytes>,
#[serde(rename="codeAddress")]
pub code_address: Option<Address>,
}