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

@@ -22,20 +22,20 @@ use state::{Env, AccountState, Transaction, Log};
/// State test deserialization.
#[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct State {
/// Environment.
pub env: Env,
/// Output.
#[serde(rename="out")]
#[serde(rename = "out")]
pub output: Bytes,
/// Pre state.
#[serde(rename="pre")]
#[serde(rename = "pre")]
pub pre_state: AccountState,
/// Post state.
#[serde(rename="post")]
#[serde(rename = "post")]
pub post_state: AccountState,
/// Post state root.
#[serde(rename="postStateRoot")]
pub post_state_root: H256,
/// Transaction.
pub transaction: Transaction,

View File

@@ -52,10 +52,10 @@ pub struct State {
/// Environment.
pub env: Env,
/// Pre state.
#[serde(rename="pre")]
#[serde(rename = "pre")]
pub pre_state: AccountState,
/// Post state.
#[serde(rename="post")]
#[serde(rename = "post")]
pub post_states: BTreeMap<ForkSpec, Vec<PostStateResult>>,
/// Transaction.
pub transaction: MultiTransaction,
@@ -63,19 +63,18 @@ pub struct State {
/// State test transaction deserialization.
#[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MultiTransaction {
/// Transaction data set.
pub data: Vec<Bytes>,
/// Gas limit set.
#[serde(rename="gasLimit")]
pub gas_limit: Vec<Uint>,
/// Gas price.
#[serde(rename="gasPrice")]
pub gas_price: Uint,
/// Nonce.
pub nonce: Uint,
/// Secret key.
#[serde(rename="secretKey")]
#[serde(rename = "secretKey")]
pub secret: Option<H256>,
/// To.
pub to: MaybeEmpty<Address>,

View File

@@ -23,19 +23,18 @@ use maybe::MaybeEmpty;
/// State test transaction deserialization.
#[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Transaction {
/// Transaction data.
pub data: Bytes,
/// Gas limit.
#[serde(rename="gasLimit")]
pub gas_limit: Uint,
/// Gas price.
#[serde(rename="gasPrice")]
pub gas_price: Uint,
/// Nonce.
pub nonce: Uint,
/// Secret key.
#[serde(rename="secretKey")]
#[serde(rename = "secretKey")]
pub secret: Option<H256>,
/// To.
pub to: MaybeEmpty<Address>,