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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 140 additions and 311 deletions

View File

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

View File

@ -23,11 +23,11 @@ use blockchain::transaction::Transaction;
/// Blockchain test block deserializer. /// Blockchain test block deserializer.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
pub struct Block { pub struct Block {
#[serde(rename="blockHeader")] #[serde(rename = "blockHeader")]
header: Option<Header>, header: Option<Header>,
rlp: Bytes, rlp: Bytes,
transactions: Option<Vec<Transaction>>, transactions: Option<Vec<Transaction>>,
#[serde(rename="uncleHeaders")] #[serde(rename = "uncleHeaders")]
uncles: Option<Vec<Header>>, uncles: Option<Vec<Header>>,
} }

View File

@ -25,23 +25,23 @@ use spec::{ForkSpec, Genesis, Seal, Ethereum};
/// Blockchain deserialization. /// Blockchain deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BlockChain { pub struct BlockChain {
/// Genesis block header. /// Genesis block header.
#[serde(rename="genesisBlockHeader")] #[serde(rename = "genesisBlockHeader")]
pub genesis_block: Header, pub genesis_block: Header,
/// Genesis block rlp. /// Genesis block rlp.
#[serde(rename="genesisRLP")] #[serde(rename = "genesisRLP")]
pub genesis_rlp: Option<Bytes>, pub genesis_rlp: Option<Bytes>,
/// Blocks. /// Blocks.
pub blocks: Vec<Block>, pub blocks: Vec<Block>,
/// Post state. /// Post state.
#[serde(rename="postState")]
pub post_state: State, pub post_state: State,
/// Pre state. /// Pre state.
#[serde(rename="pre")] #[serde(rename = "pre")]
pub pre_state: State, pub pre_state: State,
/// Hash of best block. /// Hash of best block.
#[serde(rename="lastblockhash")] #[serde(rename = "lastblockhash")]
pub best_block: H256, pub best_block: H256,
/// Network. /// Network.
pub network: ForkSpec, pub network: ForkSpec,

View File

@ -22,26 +22,23 @@ use bytes::Bytes;
/// Blockchain test header deserializer. /// Blockchain test header deserializer.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Header { pub struct Header {
/// Blocks bloom. /// Blocks bloom.
pub bloom: Bloom, pub bloom: Bloom,
/// Blocks author. /// Blocks author.
#[serde(rename="coinbase")] #[serde(rename = "coinbase")]
pub author: Address, pub author: Address,
/// Difficulty. /// Difficulty.
pub difficulty: Uint, pub difficulty: Uint,
#[serde(rename="extraData")]
/// Extra data. /// Extra data.
pub extra_data: Bytes, pub extra_data: Bytes,
/// Gas limit. /// Gas limit.
#[serde(rename="gasLimit")]
pub gas_limit: Uint, pub gas_limit: Uint,
/// Gas used. /// Gas used.
#[serde(rename="gasUsed")]
pub gas_used: Uint, pub gas_used: Uint,
/// Hash. /// Hash.
pub hash: H256, pub hash: H256,
#[serde(rename="mixHash")]
/// Mix hash. /// Mix hash.
pub mix_hash: H256, pub mix_hash: H256,
/// Seal nonce. /// Seal nonce.
@ -49,21 +46,19 @@ pub struct Header {
/// Block number. /// Block number.
pub number: Uint, pub number: Uint,
/// Parent hash. /// Parent hash.
#[serde(rename="parentHash")]
pub parent_hash: H256, pub parent_hash: H256,
/// Receipt root. /// Receipt root.
#[serde(rename="receiptTrie")] #[serde(rename = "receiptTrie")]
pub receipts_root: H256, pub receipts_root: H256,
/// State root. /// State root.
#[serde(rename="stateRoot")]
pub state_root: H256, pub state_root: H256,
/// Timestamp. /// Timestamp.
pub timestamp: Uint, pub timestamp: Uint,
/// Transactions root. /// Transactions root.
#[serde(rename="transactionsTrie")] #[serde(rename = "transactionsTrie")]
pub transactions_root: H256, pub transactions_root: H256,
/// Uncles hash. /// Uncles hash.
#[serde(rename="uncleHash")] #[serde(rename = "uncleHash")]
pub uncles_hash: H256, pub uncles_hash: H256,
} }

View File

@ -21,11 +21,10 @@ use bytes::Bytes;
/// Blockchain test transaction deserialization. /// Blockchain test transaction deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Transaction { pub struct Transaction {
data: Bytes, data: Bytes,
#[serde(rename="gasLimit")]
gas_limit: Uint, gas_limit: Uint,
#[serde(rename="gasPrice")]
gas_price: Uint, gas_price: Uint,
nonce: Uint, nonce: Uint,
r: Uint, r: Uint,

View File

@ -23,49 +23,37 @@ use super::ValidatorSet;
/// Authority params deserialization. /// Authority params deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AuthorityRoundParams { pub struct AuthorityRoundParams {
/// Block duration, in seconds. /// Block duration, in seconds.
#[serde(rename="stepDuration")]
pub step_duration: Uint, pub step_duration: Uint,
/// Valid authorities /// Valid authorities
pub validators: ValidatorSet, pub validators: ValidatorSet,
/// Starting step. Determined automatically if not specified. /// Starting step. Determined automatically if not specified.
/// To be used for testing only. /// To be used for testing only.
#[serde(rename="startStep")]
pub start_step: Option<Uint>, pub start_step: Option<Uint>,
/// Block at which score validation should start. /// Block at which score validation should start.
#[serde(rename="validateScoreTransition")]
pub validate_score_transition: Option<Uint>, pub validate_score_transition: Option<Uint>,
/// Block from which monotonic steps start. /// Block from which monotonic steps start.
#[serde(rename="validateStepTransition")]
pub validate_step_transition: Option<Uint>, pub validate_step_transition: Option<Uint>,
/// Whether transitions should be immediate. /// Whether transitions should be immediate.
#[serde(rename="immediateTransitions")]
pub immediate_transitions: Option<bool>, pub immediate_transitions: Option<bool>,
/// Reward per block in wei. /// Reward per block in wei.
#[serde(rename="blockReward")]
pub block_reward: Option<Uint>, pub block_reward: Option<Uint>,
/// Block at which the block reward contract should start being used. /// Block at which the block reward contract should start being used.
#[serde(rename="blockRewardContractTransition")]
pub block_reward_contract_transition: Option<Uint>, pub block_reward_contract_transition: Option<Uint>,
/// Block reward contract address (setting the block reward contract /// Block reward contract address (setting the block reward contract
/// overrides the static block reward definition). /// overrides the static block reward definition).
#[serde(rename="blockRewardContractAddress")]
pub block_reward_contract_address: Option<Address>, pub block_reward_contract_address: Option<Address>,
/// Block reward code. This overrides the block reward contract address. /// Block reward code. This overrides the block reward contract address.
#[serde(rename="blockRewardContractCode")]
pub block_reward_contract_code: Option<Bytes>, pub block_reward_contract_code: Option<Bytes>,
/// Block at which maximum uncle count should be considered. /// Block at which maximum uncle count should be considered.
#[serde(rename="maximumUncleCountTransition")]
pub maximum_uncle_count_transition: Option<Uint>, pub maximum_uncle_count_transition: Option<Uint>,
/// Maximum number of accepted uncles. /// Maximum number of accepted uncles.
#[serde(rename="maximumUncleCount")]
pub maximum_uncle_count: Option<Uint>, pub maximum_uncle_count: Option<Uint>,
/// Block at which empty step messages should start. /// Block at which empty step messages should start.
#[serde(rename="emptyStepsTransition")]
pub empty_steps_transition: Option<Uint>, pub empty_steps_transition: Option<Uint>,
/// Maximum number of accepted empty steps. /// Maximum number of accepted empty steps.
#[serde(rename="maximumEmptySteps")]
pub maximum_empty_steps: Option<Uint>, pub maximum_empty_steps: Option<Uint>,
} }

View File

@ -21,9 +21,9 @@ use super::ValidatorSet;
/// Authority params deserialization. /// Authority params deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BasicAuthorityParams { pub struct BasicAuthorityParams {
/// Block duration. /// Block duration.
#[serde(rename="durationLimit")]
pub duration_limit: Uint, pub duration_limit: Uint,
/// Valid authorities /// Valid authorities
pub validators: ValidatorSet, pub validators: ValidatorSet,

View File

@ -45,15 +45,13 @@ pub struct AltBn128Pairing {
/// Pricing variants. /// Pricing variants.
#[derive(Debug, PartialEq, Deserialize, Clone)] #[derive(Debug, PartialEq, Deserialize, Clone)]
#[serde(rename_all = "snake_case")]
pub enum Pricing { pub enum Pricing {
/// Linear pricing. /// Linear pricing.
#[serde(rename="linear")]
Linear(Linear), Linear(Linear),
/// Pricing for modular exponentiation. /// Pricing for modular exponentiation.
#[serde(rename="modexp")]
Modexp(Modexp), Modexp(Modexp),
/// Pricing for alt_bn128_pairing exponentiation. /// Pricing for alt_bn128_pairing exponentiation.
#[serde(rename="alt_bn128_pairing")]
AltBn128Pairing(AltBn128Pairing), AltBn128Pairing(AltBn128Pairing),
} }

View File

@ -20,23 +20,20 @@ use super::{Ethash, BasicAuthority, AuthorityRound, Tendermint, NullEngine, Inst
/// Engine deserialization. /// Engine deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum Engine { pub enum Engine {
/// Null engine. /// Null engine.
#[serde(rename="null")]
Null(NullEngine), Null(NullEngine),
/// Instantly sealing engine. /// Instantly sealing engine.
#[serde(rename="instantSeal")]
InstantSeal(Option<InstantSeal>), InstantSeal(Option<InstantSeal>),
/// Ethash engine. /// Ethash engine.
#[serde(rename = "Ethash")]
Ethash(Ethash), Ethash(Ethash),
/// BasicAuthority engine. /// BasicAuthority engine.
#[serde(rename="basicAuthority")]
BasicAuthority(BasicAuthority), BasicAuthority(BasicAuthority),
/// AuthorityRound engine. /// AuthorityRound engine.
#[serde(rename="authorityRound")]
AuthorityRound(AuthorityRound), AuthorityRound(AuthorityRound),
/// Tendermint engine. /// Tendermint engine.
#[serde(rename="tendermint")]
Tendermint(Tendermint) Tendermint(Tendermint)
} }

View File

@ -31,89 +31,67 @@ pub enum BlockReward {
/// Deserializable doppelganger of EthashParams. /// Deserializable doppelganger of EthashParams.
#[derive(Clone, Debug, PartialEq, Deserialize)] #[derive(Clone, Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EthashParams { pub struct EthashParams {
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="minimumDifficulty")]
#[serde(deserialize_with="uint::validate_non_zero")] #[serde(deserialize_with="uint::validate_non_zero")]
pub minimum_difficulty: Uint, pub minimum_difficulty: Uint,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="difficultyBoundDivisor")]
#[serde(deserialize_with="uint::validate_non_zero")] #[serde(deserialize_with="uint::validate_non_zero")]
pub difficulty_bound_divisor: Uint, pub difficulty_bound_divisor: Uint,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="difficultyIncrementDivisor")]
#[serde(default, deserialize_with="uint::validate_optional_non_zero")] #[serde(default, deserialize_with="uint::validate_optional_non_zero")]
pub difficulty_increment_divisor: Option<Uint>, pub difficulty_increment_divisor: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="metropolisDifficultyIncrementDivisor")]
#[serde(default, deserialize_with="uint::validate_optional_non_zero")] #[serde(default, deserialize_with="uint::validate_optional_non_zero")]
pub metropolis_difficulty_increment_divisor: Option<Uint>, pub metropolis_difficulty_increment_divisor: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="durationLimit")]
pub duration_limit: Option<Uint>, pub duration_limit: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="homesteadTransition")]
pub homestead_transition: Option<Uint>, pub homestead_transition: Option<Uint>,
/// Reward per block in wei. /// Reward per block in wei.
#[serde(rename="blockReward")]
pub block_reward: Option<BlockReward>, pub block_reward: Option<BlockReward>,
/// Block at which the block reward contract should start being used. /// Block at which the block reward contract should start being used.
#[serde(rename="blockRewardContractTransition")]
pub block_reward_contract_transition: Option<Uint>, pub block_reward_contract_transition: Option<Uint>,
/// Block reward contract address (setting the block reward contract /// Block reward contract address (setting the block reward contract
/// overrides all other block reward parameters). /// overrides all other block reward parameters).
#[serde(rename="blockRewardContractAddress")]
pub block_reward_contract_address: Option<Address>, pub block_reward_contract_address: Option<Address>,
/// Block reward code. This overrides the block reward contract address. /// Block reward code. This overrides the block reward contract address.
#[serde(rename="blockRewardContractCode")]
pub block_reward_contract_code: Option<Bytes>, pub block_reward_contract_code: Option<Bytes>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="daoHardforkTransition")]
pub dao_hardfork_transition: Option<Uint>, pub dao_hardfork_transition: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="daoHardforkBeneficiary")]
pub dao_hardfork_beneficiary: Option<Address>, pub dao_hardfork_beneficiary: Option<Address>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="daoHardforkAccounts")]
pub dao_hardfork_accounts: Option<Vec<Address>>, pub dao_hardfork_accounts: Option<Vec<Address>>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="difficultyHardforkTransition")]
pub difficulty_hardfork_transition: Option<Uint>, pub difficulty_hardfork_transition: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="difficultyHardforkBoundDivisor")]
#[serde(default, deserialize_with="uint::validate_optional_non_zero")] #[serde(default, deserialize_with="uint::validate_optional_non_zero")]
pub difficulty_hardfork_bound_divisor: Option<Uint>, pub difficulty_hardfork_bound_divisor: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="bombDefuseTransition")]
pub bomb_defuse_transition: Option<Uint>, pub bomb_defuse_transition: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="eip100bTransition")]
pub eip100b_transition: Option<Uint>, pub eip100b_transition: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="ecip1010PauseTransition")]
pub ecip1010_pause_transition: Option<Uint>, pub ecip1010_pause_transition: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="ecip1010ContinueTransition")]
pub ecip1010_continue_transition: Option<Uint>, pub ecip1010_continue_transition: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="ecip1017EraRounds")]
pub ecip1017_era_rounds: Option<Uint>, pub ecip1017_era_rounds: Option<Uint>,
/// Delays of difficulty bombs. /// Delays of difficulty bombs.
#[serde(rename="difficultyBombDelays")]
pub difficulty_bomb_delays: Option<BTreeMap<Uint, Uint>>, pub difficulty_bomb_delays: Option<BTreeMap<Uint, Uint>>,
/// EXPIP-2 block height /// EXPIP-2 block height
#[serde(rename="expip2Transition")]
pub expip2_transition: Option<Uint>, pub expip2_transition: Option<Uint>,
/// EXPIP-2 duration limit /// EXPIP-2 duration limit
#[serde(rename="expip2DurationLimit")]
pub expip2_duration_limit: Option<Uint>, pub expip2_duration_limit: Option<Uint>,
} }

View File

@ -23,6 +23,7 @@ use spec::Seal;
/// Spec genesis. /// Spec genesis.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Genesis { pub struct Genesis {
/// Seal. /// Seal.
pub seal: Seal, pub seal: Seal,
@ -33,26 +34,19 @@ pub struct Genesis {
/// Block timestamp, defaults to 0. /// Block timestamp, defaults to 0.
pub timestamp: Option<Uint>, pub timestamp: Option<Uint>,
/// Parent hash, defaults to 0. /// Parent hash, defaults to 0.
#[serde(rename="parentHash")]
pub parent_hash: Option<H256>, pub parent_hash: Option<H256>,
/// Gas limit. /// Gas limit.
#[serde(rename="gasLimit")]
#[serde(deserialize_with="uint::validate_non_zero")] #[serde(deserialize_with="uint::validate_non_zero")]
pub gas_limit: Uint, pub gas_limit: Uint,
/// Transactions root. /// Transactions root.
#[serde(rename="transactionsRoot")]
pub transactions_root: Option<H256>, pub transactions_root: Option<H256>,
/// Receipts root. /// Receipts root.
#[serde(rename="receiptsRoot")]
pub receipts_root: Option<H256>, pub receipts_root: Option<H256>,
/// State root. /// State root.
#[serde(rename="stateRoot")]
pub state_root: Option<H256>, pub state_root: Option<H256>,
/// Gas used. /// Gas used.
#[serde(rename="gasUsed")]
pub gas_used: Option<Uint>, pub gas_used: Option<Uint>,
/// Extra data. /// Extra data.
#[serde(rename="extraData")]
pub extra_data: Option<Bytes>, pub extra_data: Option<Bytes>,
} }

View File

@ -21,14 +21,14 @@ use uint::Uint;
/// Spec hardcoded sync. /// Spec hardcoded sync.
#[derive(Debug, PartialEq, Serialize, Deserialize)] #[derive(Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HardcodedSync { pub struct HardcodedSync {
/// Hexadecimal of the RLP encoding of the header of the block to start synchronization from. /// Hexadecimal of the RLP encoding of the header of the block to start synchronization from.
pub header: String, pub header: String,
/// Total difficulty including the block of `header`. /// Total difficulty including the block of `header`.
#[serde(rename="totalDifficulty")]
pub total_difficulty: Uint, pub total_difficulty: Uint,
/// Ordered trie roots of blocks before and including `header`. /// Ordered trie roots of blocks before and including `header`.
#[serde(rename="CHTs")] #[serde(rename = "CHTs")]
pub chts: Vec<H256>, pub chts: Vec<H256>,
} }

View File

@ -18,9 +18,9 @@
/// Instant seal engine params deserialization. /// Instant seal engine params deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct InstantSealParams { pub struct InstantSealParams {
/// Whether to enable millisecond timestamp. /// Whether to enable millisecond timestamp.
#[serde(rename="millisecondTimestamp")]
#[serde(default)] #[serde(default)]
pub millisecond_timestamp: bool, pub millisecond_timestamp: bool,
} }

View File

@ -20,9 +20,9 @@ use uint::Uint;
/// Authority params deserialization. /// Authority params deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct NullEngineParams { pub struct NullEngineParams {
/// Block reward. /// Block reward.
#[serde(rename="blockReward")]
pub block_reward: Option<Uint>, pub block_reward: Option<Uint>,
} }

View File

@ -22,140 +22,103 @@ use bytes::Bytes;
/// Spec params. /// Spec params.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Params { pub struct Params {
/// Account start nonce, defaults to 0. /// Account start nonce, defaults to 0.
#[serde(rename="accountStartNonce")]
pub account_start_nonce: Option<Uint>, pub account_start_nonce: Option<Uint>,
/// Maximum size of extra data. /// Maximum size of extra data.
#[serde(rename="maximumExtraDataSize")]
pub maximum_extra_data_size: Uint, pub maximum_extra_data_size: Uint,
/// Minimum gas limit. /// Minimum gas limit.
#[serde(rename="minGasLimit")]
pub min_gas_limit: Uint, pub min_gas_limit: Uint,
/// Network id. /// Network id.
#[serde(rename="networkID")] #[serde(rename = "networkID")]
pub network_id: Uint, pub network_id: Uint,
/// Chain id. /// Chain id.
#[serde(rename="chainID")] #[serde(rename = "chainID")]
pub chain_id: Option<Uint>, pub chain_id: Option<Uint>,
/// Name of the main ("eth") subprotocol. /// Name of the main ("eth") subprotocol.
#[serde(rename="subprotocolName")]
pub subprotocol_name: Option<String>, pub subprotocol_name: Option<String>,
/// Option fork block number to check. /// Option fork block number to check.
#[serde(rename="forkBlock")]
pub fork_block: Option<Uint>, pub fork_block: Option<Uint>,
/// Expected fork block hash. /// Expected fork block hash.
#[serde(rename="forkCanonHash")] #[serde(rename = "forkCanonHash")]
pub fork_hash: Option<H256>, pub fork_hash: Option<H256>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="eip150Transition")]
pub eip150_transition: Option<Uint>, pub eip150_transition: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="eip160Transition")]
pub eip160_transition: Option<Uint>, pub eip160_transition: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="eip161abcTransition")]
pub eip161abc_transition: Option<Uint>, pub eip161abc_transition: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="eip161dTransition")]
pub eip161d_transition: Option<Uint>, pub eip161d_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip98Transition")]
pub eip98_transition: Option<Uint>, pub eip98_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip155Transition")]
pub eip155_transition: Option<Uint>, pub eip155_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="validateChainIdTransition")]
pub validate_chain_id_transition: Option<Uint>, pub validate_chain_id_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="validateReceiptsTransition")]
pub validate_receipts_transition: Option<Uint>, pub validate_receipts_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip140Transition")]
pub eip140_transition: Option<Uint>, pub eip140_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip210Transition")]
pub eip210_transition: Option<Uint>, pub eip210_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip210ContractAddress")]
pub eip210_contract_address: Option<Address>, pub eip210_contract_address: Option<Address>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip210ContractCode")]
pub eip210_contract_code: Option<Bytes>, pub eip210_contract_code: Option<Bytes>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip210ContractGas")]
pub eip210_contract_gas: Option<Uint>, pub eip210_contract_gas: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip211Transition")]
pub eip211_transition: Option<Uint>, pub eip211_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip145Transition")]
pub eip145_transition: Option<Uint>, pub eip145_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip214Transition")]
pub eip214_transition: Option<Uint>, pub eip214_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip658Transition")]
pub eip658_transition: Option<Uint>, pub eip658_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip1052Transition")]
pub eip1052_transition: Option<Uint>, pub eip1052_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="eip1283Transition")]
pub eip1283_transition: Option<Uint>, pub eip1283_transition: Option<Uint>,
#[serde(rename="eip1014Transition")]
pub eip1014_transition: Option<Uint>, pub eip1014_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="dustProtectionTransition")]
pub dust_protection_transition: Option<Uint>, pub dust_protection_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="nonceCapIncrement")]
pub nonce_cap_increment: Option<Uint>, pub nonce_cap_increment: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
pub remove_dust_contracts : Option<bool>, pub remove_dust_contracts : Option<bool>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
#[serde(rename="gasLimitBoundDivisor")]
#[serde(deserialize_with="uint::validate_non_zero")] #[serde(deserialize_with="uint::validate_non_zero")]
pub gas_limit_bound_divisor: Uint, pub gas_limit_bound_divisor: Uint,
/// See `CommonParams` docs. /// See `CommonParams` docs.
pub registrar: Option<Address>, pub registrar: Option<Address>,
/// Apply reward flag /// Apply reward flag
#[serde(rename="applyReward")]
pub apply_reward: Option<bool>, pub apply_reward: Option<bool>,
/// Node permission contract address. /// Node permission contract address.
#[serde(rename="nodePermissionContract")]
pub node_permission_contract: Option<Address>, pub node_permission_contract: Option<Address>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="maxCodeSize")]
pub max_code_size: Option<Uint>, pub max_code_size: Option<Uint>,
/// Maximum size of transaction RLP payload. /// Maximum size of transaction RLP payload.
#[serde(rename="maxTransactionSize")]
pub max_transaction_size: Option<Uint>, pub max_transaction_size: Option<Uint>,
/// See main EthashParams docs. /// See main EthashParams docs.
#[serde(rename="maxCodeSizeTransition")]
pub max_code_size_transition: Option<Uint>, pub max_code_size_transition: Option<Uint>,
/// Transaction permission contract address. /// Transaction permission contract address.
#[serde(rename="transactionPermissionContract")]
pub transaction_permission_contract: Option<Address>, pub transaction_permission_contract: Option<Address>,
/// Block at which the transaction permission contract should start being used. /// Block at which the transaction permission contract should start being used.
#[serde(rename="transactionPermissionContractTransition")]
pub transaction_permission_contract_transition: Option<Uint>, pub transaction_permission_contract_transition: Option<Uint>,
/// Wasm activation block height, if not activated from start /// Wasm activation block height, if not activated from start
#[serde(rename="wasmActivationTransition")]
pub wasm_activation_transition: Option<Uint>, pub wasm_activation_transition: Option<Uint>,
/// KIP4 activiation block height. /// KIP4 activiation block height.
#[serde(rename="kip4Transition")]
pub kip4_transition: Option<Uint>, pub kip4_transition: Option<Uint>,
/// KIP6 activiation block height. /// KIP6 activiation block height.
#[serde(rename="kip6Transition")]
pub kip6_transition: Option<Uint>, pub kip6_transition: Option<Uint>,
} }

View File

@ -22,11 +22,11 @@ use bytes::Bytes;
/// Ethereum seal. /// Ethereum seal.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Ethereum { pub struct Ethereum {
/// Seal nonce. /// Seal nonce.
pub nonce: H64, pub nonce: H64,
/// Seal mix hash. /// Seal mix hash.
#[serde(rename="mixHash")]
pub mix_hash: H256, pub mix_hash: H256,
} }
@ -52,18 +52,15 @@ pub struct TendermintSeal {
/// Seal variants. /// Seal variants.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum Seal { pub enum Seal {
/// Ethereum seal. /// Ethereum seal.
#[serde(rename="ethereum")]
Ethereum(Ethereum), Ethereum(Ethereum),
/// AuthorityRound seal. /// AuthorityRound seal.
#[serde(rename="authorityRound")]
AuthorityRound(AuthorityRoundSeal), AuthorityRound(AuthorityRoundSeal),
/// Tendermint seal. /// Tendermint seal.
#[serde(rename="tendermint")]
Tendermint(TendermintSeal), Tendermint(TendermintSeal),
/// Generic seal. /// Generic seal.
#[serde(rename="generic")]
Generic(Bytes), Generic(Bytes),
} }

View File

@ -38,11 +38,11 @@ pub enum ForkSpec {
/// Spec deserialization. /// Spec deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Spec { pub struct Spec {
/// Spec name. /// Spec name.
pub name: String, pub name: String,
/// Special fork name. /// Special fork name.
#[serde(rename="dataDir")]
pub data_dir: Option<String>, pub data_dir: Option<String>,
/// Engine. /// Engine.
pub engine: Engine, pub engine: Engine,
@ -55,7 +55,6 @@ pub struct Spec {
/// Boot nodes. /// Boot nodes.
pub nodes: Option<Vec<String>>, pub nodes: Option<Vec<String>>,
/// Hardcoded synchronization for the light client. /// Hardcoded synchronization for the light client.
#[serde(rename="hardcodedSync")]
pub hardcoded_sync: Option<HardcodedSync>, pub hardcoded_sync: Option<HardcodedSync>,
} }

View File

@ -21,23 +21,19 @@ use super::ValidatorSet;
/// Tendermint params deserialization. /// Tendermint params deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TendermintParams { pub struct TendermintParams {
/// Valid validators. /// Valid validators.
pub validators: ValidatorSet, pub validators: ValidatorSet,
/// Propose step timeout in milliseconds. /// Propose step timeout in milliseconds.
#[serde(rename="timeoutPropose")]
pub timeout_propose: Option<Uint>, pub timeout_propose: Option<Uint>,
/// Prevote step timeout in milliseconds. /// Prevote step timeout in milliseconds.
#[serde(rename="timeoutPrevote")]
pub timeout_prevote: Option<Uint>, pub timeout_prevote: Option<Uint>,
/// Precommit step timeout in milliseconds. /// Precommit step timeout in milliseconds.
#[serde(rename="timeoutPrecommit")]
pub timeout_precommit: Option<Uint>, pub timeout_precommit: Option<Uint>,
/// Commit step timeout in milliseconds. /// Commit step timeout in milliseconds.
#[serde(rename="timeoutCommit")]
pub timeout_commit: Option<Uint>, pub timeout_commit: Option<Uint>,
/// Reward per block. /// Reward per block.
#[serde(rename="blockReward")]
pub block_reward: Option<Uint>, pub block_reward: Option<Uint>,
} }

View File

@ -22,18 +22,15 @@ use hash::Address;
/// Different ways of specifying validators. /// Different ways of specifying validators.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum ValidatorSet { pub enum ValidatorSet {
/// A simple list of authorities. /// A simple list of authorities.
#[serde(rename="list")]
List(Vec<Address>), List(Vec<Address>),
/// Address of a contract that indicates the list of authorities. /// Address of a contract that indicates the list of authorities.
#[serde(rename="safeContract")]
SafeContract(Address), SafeContract(Address),
/// Address of a contract that indicates the list of authorities and enables reporting of theor misbehaviour using transactions. /// Address of a contract that indicates the list of authorities and enables reporting of theor misbehaviour using transactions.
#[serde(rename="contract")]
Contract(Address), Contract(Address),
/// A map of starting blocks for each validator set. /// A map of starting blocks for each validator set.
#[serde(rename="multi")]
Multi(BTreeMap<Uint, ValidatorSet>), Multi(BTreeMap<Uint, ValidatorSet>),
} }

View File

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

View File

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

View File

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

View File

@ -25,24 +25,19 @@ use uint::Uint;
/// Blockchain test header deserializer. /// Blockchain test header deserializer.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DifficultyTestCase { pub struct DifficultyTestCase {
/// Parent timestamp. /// Parent timestamp.
#[serde(rename="parentTimestamp")]
pub parent_timestamp: Uint, pub parent_timestamp: Uint,
/// Parent difficulty. /// Parent difficulty.
#[serde(rename="parentDifficulty")]
pub parent_difficulty: Uint, pub parent_difficulty: Uint,
/// Parent uncle hash. /// Parent uncle hash.
#[serde(rename="parentUncles")]
pub parent_uncles: H256, pub parent_uncles: H256,
/// Current timestamp. /// Current timestamp.
#[serde(rename="currentTimestamp")]
pub current_timestamp: Uint, pub current_timestamp: Uint,
/// Current difficulty. /// Current difficulty.
#[serde(rename="currentDifficulty")]
pub current_difficulty: Uint, pub current_difficulty: Uint,
/// Current block number. /// Current block number.
#[serde(rename="currentBlockNumber")]
pub current_block_number: Uint, pub current_block_number: Uint,
} }

View File

@ -23,14 +23,13 @@ use maybe::MaybeEmpty;
/// Transaction test transaction deserialization. /// Transaction test transaction deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Transaction { pub struct Transaction {
/// Transaction data. /// Transaction data.
pub data: Bytes, pub data: Bytes,
/// Gas limit. /// Gas limit.
#[serde(rename="gasLimit")]
pub gas_limit: Uint, pub gas_limit: Uint,
/// Gas price. /// Gas price.
#[serde(rename="gasPrice")]
pub gas_price: Uint, pub gas_price: Uint,
/// Nonce. /// Nonce.
pub nonce: Uint, pub nonce: Uint,

View File

@ -23,7 +23,7 @@ use trie::Input;
#[derive(Debug, Deserialize, PartialEq)] #[derive(Debug, Deserialize, PartialEq)]
pub struct Trie { pub struct Trie {
/// Trie test input. /// Trie test input.
#[serde(rename="in")] #[serde(rename = "in")]
pub input: Input, pub input: Input,
/// Trie root hash. /// Trie root hash.
pub root: H256, pub root: H256,

View File

@ -23,13 +23,13 @@ use maybe::MaybeEmpty;
/// Vm call deserialization. /// Vm call deserialization.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Call { pub struct Call {
/// Call data. /// Call data.
pub data: Bytes, pub data: Bytes,
/// Call destination. /// Call destination.
pub destination: MaybeEmpty<Address>, pub destination: MaybeEmpty<Address>,
/// Gas limit. /// Gas limit.
#[serde(rename="gasLimit")]
pub gas_limit: Uint, pub gas_limit: Uint,
/// Call value. /// Call value.
pub value: Uint, pub value: Uint,

View File

@ -22,19 +22,19 @@ use uint::Uint;
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
pub struct Env { pub struct Env {
/// Address. /// Address.
#[serde(rename="currentCoinbase")] #[serde(rename = "currentCoinbase")]
pub author: Address, pub author: Address,
/// Difficulty /// Difficulty
#[serde(rename="currentDifficulty")] #[serde(rename = "currentDifficulty")]
pub difficulty: Uint, pub difficulty: Uint,
/// Gas limit. /// Gas limit.
#[serde(rename="currentGasLimit")] #[serde(rename = "currentGasLimit")]
pub gas_limit: Uint, pub gas_limit: Uint,
/// Number. /// Number.
#[serde(rename="currentNumber")] #[serde(rename = "currentNumber")]
pub number: Uint, pub number: Uint,
/// Timestamp. /// Timestamp.
#[serde(rename="currentTimestamp")] #[serde(rename = "currentTimestamp")]
pub timestamp: Uint, pub timestamp: Uint,
} }

View File

@ -21,11 +21,12 @@ use bytes::Bytes;
/// Executed transaction. /// Executed transaction.
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Transaction { pub struct Transaction {
/// Contract address. /// Contract address.
pub address: Address, pub address: Address,
/// Transaction sender. /// Transaction sender.
#[serde(rename="caller")] #[serde(rename = "caller")]
pub sender: Address, pub sender: Address,
/// Contract code. /// Contract code.
pub code: Bytes, pub code: Bytes,
@ -34,7 +35,6 @@ pub struct Transaction {
/// Gas. /// Gas.
pub gas: Uint, pub gas: Uint,
/// Gas price. /// Gas price.
#[serde(rename="gasPrice")]
pub gas_price: Uint, pub gas_price: Uint,
/// Transaction origin. /// Transaction origin.
pub origin: Address, pub origin: Address,

View File

@ -26,26 +26,26 @@ use vm::{Transaction, Call, Env};
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
pub struct Vm { pub struct Vm {
/// Contract calls made internaly by executed transaction. /// Contract calls made internaly by executed transaction.
#[serde(rename="callcreates")] #[serde(rename = "callcreates")]
pub calls: Option<Vec<Call>>, pub calls: Option<Vec<Call>>,
/// Env info. /// Env info.
pub env: Env, pub env: Env,
/// Executed transaction /// Executed transaction
#[serde(rename="exec")] #[serde(rename = "exec")]
pub transaction: Transaction, pub transaction: Transaction,
/// Gas left after transaction execution. /// Gas left after transaction execution.
#[serde(rename="gas")] #[serde(rename = "gas")]
pub gas_left: Option<Uint>, pub gas_left: Option<Uint>,
/// Hash of logs created during execution of transaction. /// Hash of logs created during execution of transaction.
pub logs: Option<H256>, pub logs: Option<H256>,
/// Transaction output. /// Transaction output.
#[serde(rename="out")] #[serde(rename = "out")]
pub output: Option<Bytes>, pub output: Option<Bytes>,
/// Post execution vm state. /// Post execution vm state.
#[serde(rename="post")] #[serde(rename = "post")]
pub post_state: Option<State>, pub post_state: Option<State>,
/// Pre execution vm state. /// Pre execution vm state.
#[serde(rename="pre")] #[serde(rename = "pre")]
pub pre_state: State, pub pre_state: State,
} }

View File

@ -1141,7 +1141,7 @@ struct Operating {
no_persistent_txqueue: Option<bool>, no_persistent_txqueue: Option<bool>,
no_hardcoded_sync: Option<bool>, no_hardcoded_sync: Option<bool>,
#[serde(rename="public_node")] #[serde(rename = "public_node")]
_legacy_public_node: Option<bool>, _legacy_public_node: Option<bool>,
} }
@ -1173,15 +1173,15 @@ struct PrivateTransactions {
struct Ui { struct Ui {
path: Option<String>, path: Option<String>,
#[serde(rename="force")] #[serde(rename = "force")]
_legacy_force: Option<bool>, _legacy_force: Option<bool>,
#[serde(rename="disable")] #[serde(rename = "disable")]
_legacy_disable: Option<bool>, _legacy_disable: Option<bool>,
#[serde(rename="port")] #[serde(rename = "port")]
_legacy_port: Option<u16>, _legacy_port: Option<u16>,
#[serde(rename="interface")] #[serde(rename = "interface")]
_legacy_interface: Option<String>, _legacy_interface: Option<String>,
#[serde(rename="hosts")] #[serde(rename = "hosts")]
_legacy_hosts: Option<Vec<String>>, _legacy_hosts: Option<Vec<String>>,
} }
@ -1244,21 +1244,21 @@ struct Ipc {
#[derive(Default, Debug, PartialEq, Deserialize)] #[derive(Default, Debug, PartialEq, Deserialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
struct Dapps { struct Dapps {
#[serde(rename="disable")] #[serde(rename = "disable")]
_legacy_disable: Option<bool>, _legacy_disable: Option<bool>,
#[serde(rename="port")] #[serde(rename = "port")]
_legacy_port: Option<u16>, _legacy_port: Option<u16>,
#[serde(rename="interface")] #[serde(rename = "interface")]
_legacy_interface: Option<String>, _legacy_interface: Option<String>,
#[serde(rename="hosts")] #[serde(rename = "hosts")]
_legacy_hosts: Option<Vec<String>>, _legacy_hosts: Option<Vec<String>>,
#[serde(rename="cors")] #[serde(rename = "cors")]
_legacy_cors: Option<String>, _legacy_cors: Option<String>,
#[serde(rename="path")] #[serde(rename = "path")]
_legacy_path: Option<String>, _legacy_path: Option<String>,
#[serde(rename="user")] #[serde(rename = "user")]
_legacy_user: Option<String>, _legacy_user: Option<String>,
#[serde(rename="pass")] #[serde(rename = "pass")]
_legacy_pass: Option<String>, _legacy_pass: Option<String>,
} }

View File

@ -44,14 +44,14 @@ impl Serialize for BlockTransactions {
/// Block representation /// Block representation
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all="camelCase")] #[serde(rename_all = "camelCase")]
pub struct Block { pub struct Block {
/// Hash of the block /// Hash of the block
pub hash: Option<H256>, pub hash: Option<H256>,
/// Hash of the parent /// Hash of the parent
pub parent_hash: H256, pub parent_hash: H256,
/// Hash of the uncles /// Hash of the uncles
#[serde(rename="sha3Uncles")] #[serde(rename = "sha3Uncles")]
pub uncles_hash: H256, pub uncles_hash: H256,
/// Authors address /// Authors address
pub author: H160, pub author: H160,
@ -91,14 +91,14 @@ pub struct Block {
/// Block header representation. /// Block header representation.
#[derive(Debug, Clone, Serialize, PartialEq, Eq)] #[derive(Debug, Clone, Serialize, PartialEq, Eq)]
#[serde(rename_all="camelCase")] #[serde(rename_all = "camelCase")]
pub struct Header { pub struct Header {
/// Hash of the block /// Hash of the block
pub hash: Option<H256>, pub hash: Option<H256>,
/// Hash of the parent /// Hash of the parent
pub parent_hash: H256, pub parent_hash: H256,
/// Hash of the uncles /// Hash of the uncles
#[serde(rename="sha3Uncles")] #[serde(rename = "sha3Uncles")]
pub uncles_hash: H256, pub uncles_hash: H256,
/// Authors address /// Authors address
pub author: H160, pub author: H160,

View File

@ -20,13 +20,13 @@ use v1::types::{Bytes, H160, U256};
/// Call request /// Call request
#[derive(Debug, Default, PartialEq, Deserialize)] #[derive(Debug, Default, PartialEq, Deserialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct CallRequest { pub struct CallRequest {
/// From /// From
pub from: Option<H160>, pub from: Option<H160>,
/// To /// To
pub to: Option<H160>, pub to: Option<H160>,
/// Gas Price /// Gas Price
#[serde(rename="gasPrice")]
pub gas_price: Option<U256>, pub gas_price: Option<U256>,
/// Gas /// Gas
pub gas: Option<U256>, pub gas: Option<U256>,

View File

@ -161,18 +161,16 @@ pub struct ConfirmationResponseWithToken {
/// Confirmation payload, i.e. the thing to be confirmed /// Confirmation payload, i.e. the thing to be confirmed
#[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] #[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub enum ConfirmationPayload { pub enum ConfirmationPayload {
/// Send Transaction /// Send Transaction
#[serde(rename="sendTransaction")]
SendTransaction(TransactionRequest), SendTransaction(TransactionRequest),
/// Sign Transaction /// Sign Transaction
#[serde(rename="signTransaction")]
SignTransaction(TransactionRequest), SignTransaction(TransactionRequest),
/// Signature /// Signature
#[serde(rename="sign")] #[serde(rename = "sign")]
EthSignMessage(SignRequest), EthSignMessage(SignRequest),
/// Decryption /// Decryption
#[serde(rename="decrypt")]
Decrypt(DecryptRequest), Decrypt(DecryptRequest),
} }
@ -196,11 +194,11 @@ impl From<helpers::ConfirmationPayload> for ConfirmationPayload {
/// Possible modifications to the confirmed transaction sent by `Trusted Signer` /// Possible modifications to the confirmed transaction sent by `Trusted Signer`
#[derive(Debug, PartialEq, Serialize, Deserialize)] #[derive(Debug, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct TransactionModification { pub struct TransactionModification {
/// Modified transaction sender /// Modified transaction sender
pub sender: Option<H160>, pub sender: Option<H160>,
/// Modified gas price /// Modified gas price
#[serde(rename="gasPrice")]
pub gas_price: Option<U256>, pub gas_price: Option<U256>,
/// Modified gas /// Modified gas
pub gas: Option<U256>, pub gas: Option<U256>,

View File

@ -20,18 +20,15 @@ use updater::{self, CapState};
/// Capability info /// Capability info
#[derive(Debug, PartialEq, Serialize)] #[derive(Debug, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum ConsensusCapability { pub enum ConsensusCapability {
/// Unknown. /// Unknown.
#[serde(rename="unknown")]
Unknown, Unknown,
/// Capable of consensus indefinitely. /// Capable of consensus indefinitely.
#[serde(rename="capable")]
Capable, Capable,
/// Capable of consensus up until a definite block. /// Capable of consensus up until a definite block.
#[serde(rename="capableUntil")]
CapableUntil(u64), CapableUntil(u64),
/// Incapable of consensus since a particular block. /// Incapable of consensus since a particular block.
#[serde(rename="incapableSince")]
IncapableSince(u64), IncapableSince(u64),
} }
@ -48,21 +45,18 @@ impl Into<ConsensusCapability> for CapState {
/// A release's track. /// A release's track.
#[derive(Debug, PartialEq, Serialize)] #[derive(Debug, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum ReleaseTrack { pub enum ReleaseTrack {
/// Stable track. /// Stable track.
#[serde(rename="stable")]
Stable, Stable,
/// Beta track. /// Beta track.
#[serde(rename="beta")]
Beta, Beta,
/// Nightly track. /// Nightly track.
#[serde(rename="nightly")]
Nightly, Nightly,
/// Testing track. /// Testing track.
#[serde(rename="testing")]
Testing, Testing,
/// No known track. /// No known track.
#[serde(rename="null")] #[serde(rename = "null")]
Unknown, Unknown,
} }

View File

@ -34,7 +34,7 @@ pub enum DerivationType {
#[derive(Deserialize)] #[derive(Deserialize)]
pub struct DeriveHash { pub struct DeriveHash {
hash: H256, hash: H256,
#[serde(rename="type")] #[serde(rename = "type")]
d_type: DerivationType, d_type: DerivationType,
} }
@ -42,7 +42,7 @@ pub struct DeriveHash {
#[derive(Deserialize)] #[derive(Deserialize)]
pub struct DeriveHierarchicalItem { pub struct DeriveHierarchicalItem {
index: u64, index: u64,
#[serde(rename="type")] #[serde(rename = "type")]
d_type: DerivationType, d_type: DerivationType,
} }

View File

@ -57,15 +57,13 @@ pub type Topic = VariadicValue<H256>;
/// Filter /// Filter
#[derive(Debug, PartialEq, Clone, Deserialize, Eq, Hash)] #[derive(Debug, PartialEq, Clone, Deserialize, Eq, Hash)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct Filter { pub struct Filter {
/// From Block /// From Block
#[serde(rename="fromBlock")]
pub from_block: Option<BlockNumber>, pub from_block: Option<BlockNumber>,
/// To Block /// To Block
#[serde(rename="toBlock")]
pub to_block: Option<BlockNumber>, pub to_block: Option<BlockNumber>,
/// Block hash /// Block hash
#[serde(rename="blockHash")]
pub block_hash: Option<H256>, pub block_hash: Option<H256>,
/// Address /// Address
pub address: Option<FilterAddress>, pub address: Option<FilterAddress>,

View File

@ -21,9 +21,9 @@ use v1::types::U256;
/// Values of RPC settings. /// Values of RPC settings.
#[derive(Serialize, Deserialize)] #[derive(Serialize, Deserialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct Histogram { pub struct Histogram {
/// Gas prices for bucket edges. /// Gas prices for bucket edges.
#[serde(rename="bucketBounds")]
pub bucket_bounds: Vec<U256>, pub bucket_bounds: Vec<U256>,
/// Transacion counts for each bucket. /// Transacion counts for each bucket.
pub counts: Vec<usize>, pub counts: Vec<usize>,

View File

@ -19,6 +19,7 @@ use v1::types::{Bytes, H160, H256, U256};
/// Log /// Log
#[derive(Debug, Serialize, PartialEq, Eq, Hash, Clone)] #[derive(Debug, Serialize, PartialEq, Eq, Hash, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Log { pub struct Log {
/// H160 /// H160
pub address: H160, pub address: H160,
@ -27,25 +28,19 @@ pub struct Log {
/// Data /// Data
pub data: Bytes, pub data: Bytes,
/// Block Hash /// Block Hash
#[serde(rename="blockHash")]
pub block_hash: Option<H256>, pub block_hash: Option<H256>,
/// Block Number /// Block Number
#[serde(rename="blockNumber")]
pub block_number: Option<U256>, pub block_number: Option<U256>,
/// Transaction Hash /// Transaction Hash
#[serde(rename="transactionHash")]
pub transaction_hash: Option<H256>, pub transaction_hash: Option<H256>,
/// Transaction Index /// Transaction Index
#[serde(rename="transactionIndex")]
pub transaction_index: Option<U256>, pub transaction_index: Option<U256>,
/// Log Index in Block /// Log Index in Block
#[serde(rename="logIndex")]
pub log_index: Option<U256>, pub log_index: Option<U256>,
/// Log Index in Transaction /// Log Index in Transaction
#[serde(rename="transactionLogIndex")]
pub transaction_log_index: Option<U256>, pub transaction_log_index: Option<U256>,
/// Log Type /// Log Type
#[serde(rename="type")] #[serde(rename = "type")]
pub log_type: String, pub log_type: String,
/// Whether Log Type is Removed (Geth Compatibility Field) /// Whether Log Type is Removed (Geth Compatibility Field)
#[serde(default)] #[serde(default)]

View File

@ -28,24 +28,22 @@ pub struct NodeKind {
/// Who the node is available to. /// Who the node is available to.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum Availability { pub enum Availability {
/// A personal node, not intended to be available to everyone. /// A personal node, not intended to be available to everyone.
#[serde(rename="personal")]
Personal, Personal,
/// A public, open node. /// A public, open node.
#[serde(rename="public")]
Public, Public,
} }
/// The capability of the node. /// The capability of the node.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum Capability { pub enum Capability {
/// A full node stores the full state and fully enacts incoming blocks. /// A full node stores the full state and fully enacts incoming blocks.
#[serde(rename="full")]
Full, Full,
/// A light node does a minimal header sync and fetches data as needed /// A light node does a minimal header sync and fetches data as needed
/// from the network. /// from the network.
#[serde(rename="light")]
Light, Light,
} }

View File

@ -19,15 +19,14 @@ use ethcore_private_tx::{Receipt as EthPrivateReceipt};
/// Receipt /// Receipt
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PrivateTransactionReceipt { pub struct PrivateTransactionReceipt {
/// Transaction Hash /// Transaction Hash
#[serde(rename="transactionHash")]
pub transaction_hash: H256, pub transaction_hash: H256,
/// Private contract address /// Private contract address
#[serde(rename="contractAddress")]
pub contract_address: Option<H160>, pub contract_address: Option<H160>,
/// Status code /// Status code
#[serde(rename="status")] #[serde(rename = "status")]
pub status_code: u8, pub status_code: u8,
} }
@ -45,9 +44,7 @@ impl From<EthPrivateReceipt> for PrivateTransactionReceipt {
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
pub struct PrivateTransactionReceiptAndTransaction { pub struct PrivateTransactionReceiptAndTransaction {
/// Receipt /// Receipt
#[serde(rename="receipt")]
pub receipt: PrivateTransactionReceipt, pub receipt: PrivateTransactionReceipt,
/// Transaction /// Transaction
#[serde(rename="transaction")]
pub transaction: TransactionRequest, pub transaction: TransactionRequest,
} }

View File

@ -22,30 +22,25 @@ use v1::types::H256;
/// RPC request origin /// RPC request origin
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
#[serde(rename_all = "kebab-case")]
pub enum Origin { pub enum Origin {
/// RPC server (includes request origin) /// RPC server (includes request origin)
#[serde(rename="rpc")]
Rpc(String), Rpc(String),
/// IPC server (includes session hash) /// IPC server (includes session hash)
#[serde(rename="ipc")]
Ipc(H256), Ipc(H256),
/// WS server /// WS server
#[serde(rename="ws")]
Ws { Ws {
/// Session id /// Session id
session: H256, session: H256,
}, },
/// Signer (authorized WS server) /// Signer (authorized WS server)
#[serde(rename="signer")]
Signer { Signer {
/// Session id /// Session id
session: H256 session: H256
}, },
/// From the C API /// From the C API
#[serde(rename="c-api")]
CApi, CApi,
/// Unknown /// Unknown
#[serde(rename="unknown")]
Unknown, Unknown,
} }

View File

@ -47,18 +47,15 @@ impl Serialize for Result {
/// Subscription kind. /// Subscription kind.
#[derive(Debug, Deserialize, PartialEq, Eq, Hash, Clone)] #[derive(Debug, Deserialize, PartialEq, Eq, Hash, Clone)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub enum Kind { pub enum Kind {
/// New block headers subscription. /// New block headers subscription.
#[serde(rename="newHeads")]
NewHeads, NewHeads,
/// Logs subscription. /// Logs subscription.
#[serde(rename="logs")]
Logs, Logs,
/// New Pending Transactions subscription. /// New Pending Transactions subscription.
#[serde(rename="newPendingTransactions")]
NewPendingTransactions, NewPendingTransactions,
/// Node syncing status subscription. /// Node syncing status subscription.
#[serde(rename="syncing")]
Syncing, Syncing,
} }

View File

@ -19,42 +19,35 @@ use ethcore::receipt::{Receipt as EthReceipt, RichReceipt, LocalizedReceipt, Tra
/// Receipt /// Receipt
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Receipt { pub struct Receipt {
/// Transaction Hash /// Transaction Hash
#[serde(rename="transactionHash")]
pub transaction_hash: Option<H256>, pub transaction_hash: Option<H256>,
/// Transaction index /// Transaction index
#[serde(rename="transactionIndex")]
pub transaction_index: Option<U256>, pub transaction_index: Option<U256>,
/// Block hash /// Block hash
#[serde(rename="blockHash")]
pub block_hash: Option<H256>, pub block_hash: Option<H256>,
/// Sender /// Sender
pub from: Option<H160>, pub from: Option<H160>,
/// Recipient /// Recipient
pub to: Option<H160>, pub to: Option<H160>,
/// Block number /// Block number
#[serde(rename="blockNumber")]
pub block_number: Option<U256>, pub block_number: Option<U256>,
/// Cumulative gas used /// Cumulative gas used
#[serde(rename="cumulativeGasUsed")]
pub cumulative_gas_used: U256, pub cumulative_gas_used: U256,
/// Gas used /// Gas used
#[serde(rename="gasUsed")]
pub gas_used: Option<U256>, pub gas_used: Option<U256>,
/// Contract address /// Contract address
#[serde(rename="contractAddress")]
pub contract_address: Option<H160>, pub contract_address: Option<H160>,
/// Logs /// Logs
pub logs: Vec<Log>, pub logs: Vec<Log>,
/// State Root /// State Root
#[serde(rename="root")] #[serde(rename = "root")]
pub state_root: Option<H256>, pub state_root: Option<H256>,
/// Logs bloom /// Logs bloom
#[serde(rename="logsBloom")]
pub logs_bloom: H2048, pub logs_bloom: H2048,
/// Status code /// Status code
#[serde(rename="status")] #[serde(rename = "status")]
pub status_code: Option<U64>, pub status_code: Option<U64>,
} }

View File

@ -21,21 +21,17 @@ use v1::types::{U256, H512};
/// Sync info /// Sync info
#[derive(Default, Debug, Serialize, PartialEq)] #[derive(Default, Debug, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct SyncInfo { pub struct SyncInfo {
/// Starting block /// Starting block
#[serde(rename="startingBlock")]
pub starting_block: U256, pub starting_block: U256,
/// Current block /// Current block
#[serde(rename="currentBlock")]
pub current_block: U256, pub current_block: U256,
/// Highest block seen so far /// Highest block seen so far
#[serde(rename="highestBlock")]
pub highest_block: U256, pub highest_block: U256,
/// Warp sync snapshot chunks total. /// Warp sync snapshot chunks total.
#[serde(rename="warpChunksAmount")]
pub warp_chunks_amount: Option<U256>, pub warp_chunks_amount: Option<U256>,
/// Warp sync snpashot chunks processed. /// Warp sync snpashot chunks processed.
#[serde(rename="warpChunksProcessed")]
pub warp_chunks_processed: Option<U256>, pub warp_chunks_processed: Option<U256>,
} }
@ -69,12 +65,11 @@ pub struct PeerInfo {
/// Peer network information /// Peer network information
#[derive(Default, Debug, Serialize)] #[derive(Default, Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PeerNetworkInfo { pub struct PeerNetworkInfo {
/// Remote endpoint address /// Remote endpoint address
#[serde(rename="remoteAddress")]
pub remote_address: String, pub remote_address: String,
/// Local endpoint address /// Local endpoint address
#[serde(rename="localAddress")]
pub local_address: String, pub local_address: String,
} }
@ -150,12 +145,11 @@ impl Serialize for SyncStatus {
/// Propagation statistics for pending transaction. /// Propagation statistics for pending transaction.
#[derive(Default, Debug, Serialize)] #[derive(Default, Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct TransactionStats { pub struct TransactionStats {
/// Block no this transaction was first seen. /// Block no this transaction was first seen.
#[serde(rename="firstSeen")]
pub first_seen: u64, pub first_seen: u64,
/// Peers this transaction was propagated to with count. /// Peers this transaction was propagated to with count.
#[serde(rename="propagatedTo")]
pub propagated_to: BTreeMap<H512, usize>, pub propagated_to: BTreeMap<H512, usize>,
} }
@ -191,9 +185,9 @@ impl From<SyncTransactionStats> for TransactionStats {
/// Chain status. /// Chain status.
#[derive(Default, Debug, Serialize)] #[derive(Default, Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ChainStatus { pub struct ChainStatus {
/// Describes the gap in the blockchain, if there is one: (first, last) /// Describes the gap in the blockchain, if there is one: (first, last)
#[serde(rename="blockGap")]
pub block_gap: Option<(U256, U256)>, pub block_gap: Option<(U256, U256)>,
} }

View File

@ -66,15 +66,12 @@ impl From<et::StorageDiff> for StorageDiff {
/// A record of an executed VM operation. /// A record of an executed VM operation.
pub struct VMExecutedOperation { pub struct VMExecutedOperation {
/// The total gas used. /// The total gas used.
#[serde(rename="used")]
pub used: u64, pub used: u64,
/// The stack item placed, if any. /// The stack item placed, if any.
pub push: Vec<U256>, pub push: Vec<U256>,
/// If altered, the memory delta. /// If altered, the memory delta.
#[serde(rename="mem")]
pub mem: Option<MemoryDiff>, pub mem: Option<MemoryDiff>,
/// The altered storage value, if any. /// The altered storage value, if any.
#[serde(rename="store")]
pub store: Option<StorageDiff>, pub store: Option<StorageDiff>,
} }
@ -155,13 +152,13 @@ pub struct ChangedType<T> where T: Serialize {
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
/// Serde-friendly `Diff` shadow. /// Serde-friendly `Diff` shadow.
pub enum Diff<T> where T: Serialize { pub enum Diff<T> where T: Serialize {
#[serde(rename="=")] #[serde(rename = "=")]
Same, Same,
#[serde(rename="+")] #[serde(rename = "+")]
Born(T), Born(T),
#[serde(rename="-")] #[serde(rename = "-")]
Died(T), Died(T),
#[serde(rename="*")] #[serde(rename = "*")]
Changed(ChangedType<T>), Changed(ChangedType<T>),
} }
@ -239,21 +236,17 @@ impl From<trace::Create> for Create {
/// Call type. /// Call type.
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum CallType { pub enum CallType {
/// None /// None
#[serde(rename="none")]
None, None,
/// Call /// Call
#[serde(rename="call")]
Call, Call,
/// Call code /// Call code
#[serde(rename="callcode")]
CallCode, CallCode,
/// Delegate call /// Delegate call
#[serde(rename="delegatecall")]
DelegateCall, DelegateCall,
/// Static call /// Static call
#[serde(rename="staticcall")]
StaticCall, StaticCall,
} }
@ -271,6 +264,7 @@ impl From<vm::CallType> for CallType {
/// Call response /// Call response
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Call { pub struct Call {
/// Sender /// Sender
from: H160, from: H160,
@ -283,7 +277,6 @@ pub struct Call {
/// Input data /// Input data
input: Bytes, input: Bytes,
/// The type of the call. /// The type of the call.
#[serde(rename="callType")]
call_type: CallType, call_type: CallType,
} }
@ -302,18 +295,15 @@ impl From<trace::Call> for Call {
/// Reward type. /// Reward type.
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum RewardType { pub enum RewardType {
/// Block /// Block
#[serde(rename="block")]
Block, Block,
/// Uncle /// Uncle
#[serde(rename="uncle")]
Uncle, Uncle,
/// EmptyStep (AuthorityRound) /// EmptyStep (AuthorityRound)
#[serde(rename="emptyStep")]
EmptyStep, EmptyStep,
/// External (attributed as part of an external protocol) /// External (attributed as part of an external protocol)
#[serde(rename="external")]
External, External,
} }
@ -330,13 +320,13 @@ impl From<trace::RewardType> for RewardType {
/// Reward action /// Reward action
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Reward { pub struct Reward {
/// Author's address. /// Author's address.
pub author: H160, pub author: H160,
/// Reward amount. /// Reward amount.
pub value: U256, pub value: U256,
/// Reward type. /// Reward type.
#[serde(rename="rewardType")]
pub reward_type: RewardType, pub reward_type: RewardType,
} }
@ -352,11 +342,11 @@ impl From<trace::Reward> for Reward {
/// Suicide /// Suicide
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Suicide { pub struct Suicide {
/// Address. /// Address.
pub address: H160, pub address: H160,
/// Refund address. /// Refund address.
#[serde(rename="refundAddress")]
pub refund_address: H160, pub refund_address: H160,
/// Balance. /// Balance.
pub balance: U256, pub balance: U256,
@ -398,9 +388,9 @@ impl From<trace::Action> for Action {
/// Call Result /// Call Result
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CallResult { pub struct CallResult {
/// Gas used /// Gas used
#[serde(rename="gasUsed")]
gas_used: U256, gas_used: U256,
/// Output bytes /// Output bytes
output: Bytes, output: Bytes,
@ -417,9 +407,9 @@ impl From<trace::CallResult> for CallResult {
/// Craete Result /// Craete Result
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CreateResult { pub struct CreateResult {
/// Gas used /// Gas used
#[serde(rename="gasUsed")]
gas_used: U256, gas_used: U256,
/// Code /// Code
code: Bytes, code: Bytes,
@ -607,6 +597,7 @@ impl From<FlatTrace> for Trace {
} }
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
/// A diff of some chunk of memory. /// A diff of some chunk of memory.
pub struct TraceResults { pub struct TraceResults {
/// The output of the call/create /// The output of the call/create
@ -614,10 +605,8 @@ pub struct TraceResults {
/// The transaction trace. /// The transaction trace.
pub trace: Vec<Trace>, pub trace: Vec<Trace>,
/// The transaction trace. /// The transaction trace.
#[serde(rename="vmTrace")]
pub vm_trace: Option<VMTrace>, pub vm_trace: Option<VMTrace>,
/// The transaction trace. /// The transaction trace.
#[serde(rename="stateDiff")]
pub state_diff: Option<StateDiff>, pub state_diff: Option<StateDiff>,
} }
@ -633,6 +622,7 @@ impl From<Executed> for TraceResults {
} }
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
/// A diff of some chunk of memory. /// A diff of some chunk of memory.
pub struct TraceResultsWithTransactionHash { pub struct TraceResultsWithTransactionHash {
/// The output of the call/create /// The output of the call/create
@ -640,13 +630,10 @@ pub struct TraceResultsWithTransactionHash {
/// The transaction trace. /// The transaction trace.
pub trace: Vec<Trace>, pub trace: Vec<Trace>,
/// The transaction trace. /// The transaction trace.
#[serde(rename="vmTrace")]
pub vm_trace: Option<VMTrace>, pub vm_trace: Option<VMTrace>,
/// The transaction trace. /// The transaction trace.
#[serde(rename="stateDiff")]
pub state_diff: Option<StateDiff>, pub state_diff: Option<StateDiff>,
/// The transaction Hash. /// The transaction Hash.
#[serde(rename="transactionHash")]
pub transaction_hash: H256, pub transaction_hash: H256,
} }

View File

@ -23,18 +23,15 @@ use v1::types::{BlockNumber, H160};
/// Trace filter /// Trace filter
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct TraceFilter { pub struct TraceFilter {
/// From block /// From block
#[serde(rename="fromBlock")]
pub from_block: Option<BlockNumber>, pub from_block: Option<BlockNumber>,
/// To block /// To block
#[serde(rename="toBlock")]
pub to_block: Option<BlockNumber>, pub to_block: Option<BlockNumber>,
/// From address /// From address
#[serde(rename="fromAddress")]
pub from_address: Option<Vec<H160>>, pub from_address: Option<Vec<H160>>,
/// To address /// To address
#[serde(rename="toAddress")]
pub to_address: Option<Vec<H160>>, pub to_address: Option<Vec<H160>>,
/// Output offset /// Output offset
pub after: Option<usize>, pub after: Option<usize>,

View File

@ -25,19 +25,17 @@ use v1::types::{Bytes, H160, H256, U256, H512, U64, TransactionCondition};
/// Transaction /// Transaction
#[derive(Debug, Default, Clone, PartialEq, Serialize)] #[derive(Debug, Default, Clone, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Transaction { pub struct Transaction {
/// Hash /// Hash
pub hash: H256, pub hash: H256,
/// Nonce /// Nonce
pub nonce: U256, pub nonce: U256,
/// Block hash /// Block hash
#[serde(rename="blockHash")]
pub block_hash: Option<H256>, pub block_hash: Option<H256>,
/// Block number /// Block number
#[serde(rename="blockNumber")]
pub block_number: Option<U256>, pub block_number: Option<U256>,
/// Transaction Index /// Transaction Index
#[serde(rename="transactionIndex")]
pub transaction_index: Option<U256>, pub transaction_index: Option<U256>,
/// Sender /// Sender
pub from: H160, pub from: H160,
@ -46,7 +44,6 @@ pub struct Transaction {
/// Transfered value /// Transfered value
pub value: U256, pub value: U256,
/// Gas Price /// Gas Price
#[serde(rename="gasPrice")]
pub gas_price: U256, pub gas_price: U256,
/// Gas /// Gas
pub gas: U256, pub gas: U256,
@ -57,13 +54,10 @@ pub struct Transaction {
/// Raw transaction data /// Raw transaction data
pub raw: Bytes, pub raw: Bytes,
/// Public key of the signer. /// Public key of the signer.
#[serde(rename="publicKey")]
pub public_key: Option<H512>, pub public_key: Option<H512>,
/// The network id of the transaction, if any. /// The network id of the transaction, if any.
#[serde(rename="chainId")]
pub chain_id: Option<U64>, pub chain_id: Option<U64>,
/// The standardised V field of the signature (0 or 1). /// The standardised V field of the signature (0 or 1).
#[serde(rename="standardV")]
pub standard_v: U256, pub standard_v: U256,
/// The standardised V field of the signature. /// The standardised V field of the signature.
pub v: U256, pub v: U256,
@ -161,7 +155,7 @@ pub struct RichRawTransaction {
/// Raw transaction RLP /// Raw transaction RLP
pub raw: Bytes, pub raw: Bytes,
/// Transaction details /// Transaction details
#[serde(rename="tx")] #[serde(rename = "tx")]
pub transaction: Transaction pub transaction: Transaction
} }

View File

@ -21,10 +21,10 @@ use transaction;
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub enum TransactionCondition { pub enum TransactionCondition {
/// Valid at this minimum block number. /// Valid at this minimum block number.
#[serde(rename="block")] #[serde(rename = "block")]
Number(u64), Number(u64),
/// Valid at given unix time. /// Valid at given unix time.
#[serde(rename="time")] #[serde(rename = "time")]
Timestamp(u64), Timestamp(u64),
} }

View File

@ -25,13 +25,13 @@ use std::fmt;
/// Transaction request coming from RPC /// Transaction request coming from RPC
#[derive(Debug, Clone, Default, Eq, PartialEq, Hash, Serialize, Deserialize)] #[derive(Debug, Clone, Default, Eq, PartialEq, Hash, Serialize, Deserialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct TransactionRequest { pub struct TransactionRequest {
/// Sender /// Sender
pub from: Option<H160>, pub from: Option<H160>,
/// Recipient /// Recipient
pub to: Option<H160>, pub to: Option<H160>,
/// Gas Price /// Gas Price
#[serde(rename="gasPrice")]
pub gas_price: Option<U256>, pub gas_price: Option<U256>,
/// Gas /// Gas
pub gas: Option<U256>, pub gas: Option<U256>,

View File

@ -145,10 +145,9 @@ impl<'a, T: HexEncodable> Visitor<'a> for HexEncodeVisitor<T> {
/// Receiver of a message. Either a public key, identity (presumably symmetric), /// Receiver of a message. Either a public key, identity (presumably symmetric),
/// or broadcast over the topics. /// or broadcast over the topics.
#[derive(Deserialize)] #[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum Receiver { pub enum Receiver {
#[serde(rename="public")]
Public(Public), Public(Public),
#[serde(rename="identity")]
Identity(Identity), Identity(Identity),
} }
@ -190,13 +189,13 @@ pub struct PostRequest {
/// Request for filter or subscription creation. /// Request for filter or subscription creation.
#[derive(Deserialize)] #[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct FilterRequest { pub struct FilterRequest {
/// ID of key used for decryption. /// ID of key used for decryption.
/// ///
/// If this identity is removed, then no further messages will be returned. /// If this identity is removed, then no further messages will be returned.
/// ///
/// If optional, this will listen for broadcast messages. /// If optional, this will listen for broadcast messages.
#[serde(rename = "decryptWith")]
pub decrypt_with: Option<Identity>, pub decrypt_with: Option<Identity>,
/// Accept only messages signed by given public key. /// Accept only messages signed by given public key.
@ -237,6 +236,7 @@ pub struct FilterItem {
/// Whisper node info. /// Whisper node info.
#[derive(Serialize)] #[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct NodeInfo { pub struct NodeInfo {
/// min PoW to be accepted into the local pool. /// min PoW to be accepted into the local pool.
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@ -250,7 +250,6 @@ pub struct NodeInfo {
pub memory: usize, pub memory: usize,
/// Target memory of the pool. /// Target memory of the pool.
#[serde(rename = "targetMemory")]
pub target_memory: usize, pub target_memory: usize,
} }