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:
@@ -23,11 +23,11 @@ use blockchain::transaction::Transaction;
|
||||
/// Blockchain test block deserializer.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
pub struct Block {
|
||||
#[serde(rename="blockHeader")]
|
||||
#[serde(rename = "blockHeader")]
|
||||
header: Option<Header>,
|
||||
rlp: Bytes,
|
||||
transactions: Option<Vec<Transaction>>,
|
||||
#[serde(rename="uncleHeaders")]
|
||||
#[serde(rename = "uncleHeaders")]
|
||||
uncles: Option<Vec<Header>>,
|
||||
}
|
||||
|
||||
|
||||
@@ -25,23 +25,23 @@ use spec::{ForkSpec, Genesis, Seal, Ethereum};
|
||||
|
||||
/// Blockchain deserialization.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BlockChain {
|
||||
/// Genesis block header.
|
||||
#[serde(rename="genesisBlockHeader")]
|
||||
#[serde(rename = "genesisBlockHeader")]
|
||||
pub genesis_block: Header,
|
||||
/// Genesis block rlp.
|
||||
#[serde(rename="genesisRLP")]
|
||||
#[serde(rename = "genesisRLP")]
|
||||
pub genesis_rlp: Option<Bytes>,
|
||||
/// Blocks.
|
||||
pub blocks: Vec<Block>,
|
||||
/// Post state.
|
||||
#[serde(rename="postState")]
|
||||
pub post_state: State,
|
||||
/// Pre state.
|
||||
#[serde(rename="pre")]
|
||||
#[serde(rename = "pre")]
|
||||
pub pre_state: State,
|
||||
/// Hash of best block.
|
||||
#[serde(rename="lastblockhash")]
|
||||
#[serde(rename = "lastblockhash")]
|
||||
pub best_block: H256,
|
||||
/// Network.
|
||||
pub network: ForkSpec,
|
||||
|
||||
@@ -22,26 +22,23 @@ use bytes::Bytes;
|
||||
|
||||
/// Blockchain test header deserializer.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Header {
|
||||
/// Blocks bloom.
|
||||
pub bloom: Bloom,
|
||||
/// Blocks author.
|
||||
#[serde(rename="coinbase")]
|
||||
#[serde(rename = "coinbase")]
|
||||
pub author: Address,
|
||||
/// Difficulty.
|
||||
pub difficulty: Uint,
|
||||
#[serde(rename="extraData")]
|
||||
/// Extra data.
|
||||
pub extra_data: Bytes,
|
||||
/// Gas limit.
|
||||
#[serde(rename="gasLimit")]
|
||||
pub gas_limit: Uint,
|
||||
/// Gas used.
|
||||
#[serde(rename="gasUsed")]
|
||||
pub gas_used: Uint,
|
||||
/// Hash.
|
||||
pub hash: H256,
|
||||
#[serde(rename="mixHash")]
|
||||
/// Mix hash.
|
||||
pub mix_hash: H256,
|
||||
/// Seal nonce.
|
||||
@@ -49,21 +46,19 @@ pub struct Header {
|
||||
/// Block number.
|
||||
pub number: Uint,
|
||||
/// Parent hash.
|
||||
#[serde(rename="parentHash")]
|
||||
pub parent_hash: H256,
|
||||
/// Receipt root.
|
||||
#[serde(rename="receiptTrie")]
|
||||
#[serde(rename = "receiptTrie")]
|
||||
pub receipts_root: H256,
|
||||
/// State root.
|
||||
#[serde(rename="stateRoot")]
|
||||
pub state_root: H256,
|
||||
/// Timestamp.
|
||||
pub timestamp: Uint,
|
||||
/// Transactions root.
|
||||
#[serde(rename="transactionsTrie")]
|
||||
#[serde(rename = "transactionsTrie")]
|
||||
pub transactions_root: H256,
|
||||
/// Uncles hash.
|
||||
#[serde(rename="uncleHash")]
|
||||
#[serde(rename = "uncleHash")]
|
||||
pub uncles_hash: H256,
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,10 @@ use bytes::Bytes;
|
||||
|
||||
/// Blockchain test transaction deserialization.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Transaction {
|
||||
data: Bytes,
|
||||
#[serde(rename="gasLimit")]
|
||||
gas_limit: Uint,
|
||||
#[serde(rename="gasPrice")]
|
||||
gas_price: Uint,
|
||||
nonce: Uint,
|
||||
r: Uint,
|
||||
|
||||
@@ -23,49 +23,37 @@ use super::ValidatorSet;
|
||||
|
||||
/// Authority params deserialization.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AuthorityRoundParams {
|
||||
/// Block duration, in seconds.
|
||||
#[serde(rename="stepDuration")]
|
||||
pub step_duration: Uint,
|
||||
/// Valid authorities
|
||||
pub validators: ValidatorSet,
|
||||
/// Starting step. Determined automatically if not specified.
|
||||
/// To be used for testing only.
|
||||
#[serde(rename="startStep")]
|
||||
pub start_step: Option<Uint>,
|
||||
/// Block at which score validation should start.
|
||||
#[serde(rename="validateScoreTransition")]
|
||||
pub validate_score_transition: Option<Uint>,
|
||||
/// Block from which monotonic steps start.
|
||||
#[serde(rename="validateStepTransition")]
|
||||
pub validate_step_transition: Option<Uint>,
|
||||
/// Whether transitions should be immediate.
|
||||
#[serde(rename="immediateTransitions")]
|
||||
pub immediate_transitions: Option<bool>,
|
||||
/// Reward per block in wei.
|
||||
#[serde(rename="blockReward")]
|
||||
pub block_reward: Option<Uint>,
|
||||
/// Block at which the block reward contract should start being used.
|
||||
#[serde(rename="blockRewardContractTransition")]
|
||||
pub block_reward_contract_transition: Option<Uint>,
|
||||
/// Block reward contract address (setting the block reward contract
|
||||
/// overrides the static block reward definition).
|
||||
#[serde(rename="blockRewardContractAddress")]
|
||||
pub block_reward_contract_address: Option<Address>,
|
||||
/// Block reward code. This overrides the block reward contract address.
|
||||
#[serde(rename="blockRewardContractCode")]
|
||||
pub block_reward_contract_code: Option<Bytes>,
|
||||
/// Block at which maximum uncle count should be considered.
|
||||
#[serde(rename="maximumUncleCountTransition")]
|
||||
pub maximum_uncle_count_transition: Option<Uint>,
|
||||
/// Maximum number of accepted uncles.
|
||||
#[serde(rename="maximumUncleCount")]
|
||||
pub maximum_uncle_count: Option<Uint>,
|
||||
/// Block at which empty step messages should start.
|
||||
#[serde(rename="emptyStepsTransition")]
|
||||
pub empty_steps_transition: Option<Uint>,
|
||||
/// Maximum number of accepted empty steps.
|
||||
#[serde(rename="maximumEmptySteps")]
|
||||
pub maximum_empty_steps: Option<Uint>,
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ use super::ValidatorSet;
|
||||
|
||||
/// Authority params deserialization.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BasicAuthorityParams {
|
||||
/// Block duration.
|
||||
#[serde(rename="durationLimit")]
|
||||
pub duration_limit: Uint,
|
||||
/// Valid authorities
|
||||
pub validators: ValidatorSet,
|
||||
|
||||
@@ -45,15 +45,13 @@ pub struct AltBn128Pairing {
|
||||
|
||||
/// Pricing variants.
|
||||
#[derive(Debug, PartialEq, Deserialize, Clone)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum Pricing {
|
||||
/// Linear pricing.
|
||||
#[serde(rename="linear")]
|
||||
Linear(Linear),
|
||||
/// Pricing for modular exponentiation.
|
||||
#[serde(rename="modexp")]
|
||||
Modexp(Modexp),
|
||||
/// Pricing for alt_bn128_pairing exponentiation.
|
||||
#[serde(rename="alt_bn128_pairing")]
|
||||
AltBn128Pairing(AltBn128Pairing),
|
||||
}
|
||||
|
||||
|
||||
@@ -20,23 +20,20 @@ use super::{Ethash, BasicAuthority, AuthorityRound, Tendermint, NullEngine, Inst
|
||||
|
||||
/// Engine deserialization.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum Engine {
|
||||
/// Null engine.
|
||||
#[serde(rename="null")]
|
||||
Null(NullEngine),
|
||||
/// Instantly sealing engine.
|
||||
#[serde(rename="instantSeal")]
|
||||
InstantSeal(Option<InstantSeal>),
|
||||
/// Ethash engine.
|
||||
#[serde(rename = "Ethash")]
|
||||
Ethash(Ethash),
|
||||
/// BasicAuthority engine.
|
||||
#[serde(rename="basicAuthority")]
|
||||
BasicAuthority(BasicAuthority),
|
||||
/// AuthorityRound engine.
|
||||
#[serde(rename="authorityRound")]
|
||||
AuthorityRound(AuthorityRound),
|
||||
/// Tendermint engine.
|
||||
#[serde(rename="tendermint")]
|
||||
Tendermint(Tendermint)
|
||||
}
|
||||
|
||||
|
||||
@@ -31,89 +31,67 @@ pub enum BlockReward {
|
||||
|
||||
/// Deserializable doppelganger of EthashParams.
|
||||
#[derive(Clone, Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct EthashParams {
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="minimumDifficulty")]
|
||||
#[serde(deserialize_with="uint::validate_non_zero")]
|
||||
pub minimum_difficulty: Uint,
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="difficultyBoundDivisor")]
|
||||
#[serde(deserialize_with="uint::validate_non_zero")]
|
||||
pub difficulty_bound_divisor: Uint,
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="difficultyIncrementDivisor")]
|
||||
#[serde(default, deserialize_with="uint::validate_optional_non_zero")]
|
||||
pub difficulty_increment_divisor: Option<Uint>,
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="metropolisDifficultyIncrementDivisor")]
|
||||
#[serde(default, deserialize_with="uint::validate_optional_non_zero")]
|
||||
pub metropolis_difficulty_increment_divisor: Option<Uint>,
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="durationLimit")]
|
||||
pub duration_limit: Option<Uint>,
|
||||
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="homesteadTransition")]
|
||||
pub homestead_transition: Option<Uint>,
|
||||
/// Reward per block in wei.
|
||||
#[serde(rename="blockReward")]
|
||||
pub block_reward: Option<BlockReward>,
|
||||
/// Block at which the block reward contract should start being used.
|
||||
#[serde(rename="blockRewardContractTransition")]
|
||||
pub block_reward_contract_transition: Option<Uint>,
|
||||
/// Block reward contract address (setting the block reward contract
|
||||
/// overrides all other block reward parameters).
|
||||
#[serde(rename="blockRewardContractAddress")]
|
||||
pub block_reward_contract_address: Option<Address>,
|
||||
/// Block reward code. This overrides the block reward contract address.
|
||||
#[serde(rename="blockRewardContractCode")]
|
||||
pub block_reward_contract_code: Option<Bytes>,
|
||||
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="daoHardforkTransition")]
|
||||
pub dao_hardfork_transition: Option<Uint>,
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="daoHardforkBeneficiary")]
|
||||
pub dao_hardfork_beneficiary: Option<Address>,
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="daoHardforkAccounts")]
|
||||
pub dao_hardfork_accounts: Option<Vec<Address>>,
|
||||
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="difficultyHardforkTransition")]
|
||||
pub difficulty_hardfork_transition: Option<Uint>,
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="difficultyHardforkBoundDivisor")]
|
||||
#[serde(default, deserialize_with="uint::validate_optional_non_zero")]
|
||||
pub difficulty_hardfork_bound_divisor: Option<Uint>,
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="bombDefuseTransition")]
|
||||
pub bomb_defuse_transition: Option<Uint>,
|
||||
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="eip100bTransition")]
|
||||
pub eip100b_transition: Option<Uint>,
|
||||
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="ecip1010PauseTransition")]
|
||||
pub ecip1010_pause_transition: Option<Uint>,
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="ecip1010ContinueTransition")]
|
||||
pub ecip1010_continue_transition: Option<Uint>,
|
||||
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="ecip1017EraRounds")]
|
||||
pub ecip1017_era_rounds: Option<Uint>,
|
||||
|
||||
/// Delays of difficulty bombs.
|
||||
#[serde(rename="difficultyBombDelays")]
|
||||
pub difficulty_bomb_delays: Option<BTreeMap<Uint, Uint>>,
|
||||
|
||||
/// EXPIP-2 block height
|
||||
#[serde(rename="expip2Transition")]
|
||||
pub expip2_transition: Option<Uint>,
|
||||
/// EXPIP-2 duration limit
|
||||
#[serde(rename="expip2DurationLimit")]
|
||||
pub expip2_duration_limit: Option<Uint>,
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ use spec::Seal;
|
||||
|
||||
/// Spec genesis.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Genesis {
|
||||
/// Seal.
|
||||
pub seal: Seal,
|
||||
@@ -33,26 +34,19 @@ pub struct Genesis {
|
||||
/// Block timestamp, defaults to 0.
|
||||
pub timestamp: Option<Uint>,
|
||||
/// Parent hash, defaults to 0.
|
||||
#[serde(rename="parentHash")]
|
||||
pub parent_hash: Option<H256>,
|
||||
/// Gas limit.
|
||||
#[serde(rename="gasLimit")]
|
||||
#[serde(deserialize_with="uint::validate_non_zero")]
|
||||
pub gas_limit: Uint,
|
||||
/// Transactions root.
|
||||
#[serde(rename="transactionsRoot")]
|
||||
pub transactions_root: Option<H256>,
|
||||
/// Receipts root.
|
||||
#[serde(rename="receiptsRoot")]
|
||||
pub receipts_root: Option<H256>,
|
||||
/// State root.
|
||||
#[serde(rename="stateRoot")]
|
||||
pub state_root: Option<H256>,
|
||||
/// Gas used.
|
||||
#[serde(rename="gasUsed")]
|
||||
pub gas_used: Option<Uint>,
|
||||
/// Extra data.
|
||||
#[serde(rename="extraData")]
|
||||
pub extra_data: Option<Bytes>,
|
||||
}
|
||||
|
||||
|
||||
@@ -21,14 +21,14 @@ use uint::Uint;
|
||||
|
||||
/// Spec hardcoded sync.
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct HardcodedSync {
|
||||
/// Hexadecimal of the RLP encoding of the header of the block to start synchronization from.
|
||||
pub header: String,
|
||||
/// Total difficulty including the block of `header`.
|
||||
#[serde(rename="totalDifficulty")]
|
||||
pub total_difficulty: Uint,
|
||||
/// Ordered trie roots of blocks before and including `header`.
|
||||
#[serde(rename="CHTs")]
|
||||
#[serde(rename = "CHTs")]
|
||||
pub chts: Vec<H256>,
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
/// Instant seal engine params deserialization.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct InstantSealParams {
|
||||
/// Whether to enable millisecond timestamp.
|
||||
#[serde(rename="millisecondTimestamp")]
|
||||
#[serde(default)]
|
||||
pub millisecond_timestamp: bool,
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ use uint::Uint;
|
||||
|
||||
/// Authority params deserialization.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct NullEngineParams {
|
||||
/// Block reward.
|
||||
#[serde(rename="blockReward")]
|
||||
pub block_reward: Option<Uint>,
|
||||
}
|
||||
|
||||
|
||||
@@ -22,140 +22,103 @@ use bytes::Bytes;
|
||||
|
||||
/// Spec params.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Params {
|
||||
/// Account start nonce, defaults to 0.
|
||||
#[serde(rename="accountStartNonce")]
|
||||
pub account_start_nonce: Option<Uint>,
|
||||
/// Maximum size of extra data.
|
||||
#[serde(rename="maximumExtraDataSize")]
|
||||
pub maximum_extra_data_size: Uint,
|
||||
/// Minimum gas limit.
|
||||
#[serde(rename="minGasLimit")]
|
||||
pub min_gas_limit: Uint,
|
||||
|
||||
/// Network id.
|
||||
#[serde(rename="networkID")]
|
||||
#[serde(rename = "networkID")]
|
||||
pub network_id: Uint,
|
||||
/// Chain id.
|
||||
#[serde(rename="chainID")]
|
||||
#[serde(rename = "chainID")]
|
||||
pub chain_id: Option<Uint>,
|
||||
|
||||
/// Name of the main ("eth") subprotocol.
|
||||
#[serde(rename="subprotocolName")]
|
||||
pub subprotocol_name: Option<String>,
|
||||
|
||||
/// Option fork block number to check.
|
||||
#[serde(rename="forkBlock")]
|
||||
pub fork_block: Option<Uint>,
|
||||
/// Expected fork block hash.
|
||||
#[serde(rename="forkCanonHash")]
|
||||
#[serde(rename = "forkCanonHash")]
|
||||
pub fork_hash: Option<H256>,
|
||||
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="eip150Transition")]
|
||||
pub eip150_transition: Option<Uint>,
|
||||
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="eip160Transition")]
|
||||
pub eip160_transition: Option<Uint>,
|
||||
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="eip161abcTransition")]
|
||||
pub eip161abc_transition: Option<Uint>,
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="eip161dTransition")]
|
||||
pub eip161d_transition: Option<Uint>,
|
||||
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip98Transition")]
|
||||
pub eip98_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip155Transition")]
|
||||
pub eip155_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="validateChainIdTransition")]
|
||||
pub validate_chain_id_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="validateReceiptsTransition")]
|
||||
pub validate_receipts_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip140Transition")]
|
||||
pub eip140_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip210Transition")]
|
||||
pub eip210_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip210ContractAddress")]
|
||||
pub eip210_contract_address: Option<Address>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip210ContractCode")]
|
||||
pub eip210_contract_code: Option<Bytes>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip210ContractGas")]
|
||||
pub eip210_contract_gas: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip211Transition")]
|
||||
pub eip211_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip145Transition")]
|
||||
pub eip145_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip214Transition")]
|
||||
pub eip214_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip658Transition")]
|
||||
pub eip658_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip1052Transition")]
|
||||
pub eip1052_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="eip1283Transition")]
|
||||
pub eip1283_transition: Option<Uint>,
|
||||
#[serde(rename="eip1014Transition")]
|
||||
pub eip1014_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="dustProtectionTransition")]
|
||||
pub dust_protection_transition: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="nonceCapIncrement")]
|
||||
pub nonce_cap_increment: Option<Uint>,
|
||||
/// See `CommonParams` docs.
|
||||
pub remove_dust_contracts : Option<bool>,
|
||||
/// See `CommonParams` docs.
|
||||
#[serde(rename="gasLimitBoundDivisor")]
|
||||
#[serde(deserialize_with="uint::validate_non_zero")]
|
||||
pub gas_limit_bound_divisor: Uint,
|
||||
/// See `CommonParams` docs.
|
||||
pub registrar: Option<Address>,
|
||||
/// Apply reward flag
|
||||
#[serde(rename="applyReward")]
|
||||
pub apply_reward: Option<bool>,
|
||||
/// Node permission contract address.
|
||||
#[serde(rename="nodePermissionContract")]
|
||||
pub node_permission_contract: Option<Address>,
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="maxCodeSize")]
|
||||
pub max_code_size: Option<Uint>,
|
||||
/// Maximum size of transaction RLP payload.
|
||||
#[serde(rename="maxTransactionSize")]
|
||||
pub max_transaction_size: Option<Uint>,
|
||||
/// See main EthashParams docs.
|
||||
#[serde(rename="maxCodeSizeTransition")]
|
||||
pub max_code_size_transition: Option<Uint>,
|
||||
/// Transaction permission contract address.
|
||||
#[serde(rename="transactionPermissionContract")]
|
||||
pub transaction_permission_contract: Option<Address>,
|
||||
/// Block at which the transaction permission contract should start being used.
|
||||
#[serde(rename="transactionPermissionContractTransition")]
|
||||
pub transaction_permission_contract_transition: Option<Uint>,
|
||||
/// Wasm activation block height, if not activated from start
|
||||
#[serde(rename="wasmActivationTransition")]
|
||||
pub wasm_activation_transition: Option<Uint>,
|
||||
/// KIP4 activiation block height.
|
||||
#[serde(rename="kip4Transition")]
|
||||
pub kip4_transition: Option<Uint>,
|
||||
/// KIP6 activiation block height.
|
||||
#[serde(rename="kip6Transition")]
|
||||
pub kip6_transition: Option<Uint>,
|
||||
}
|
||||
|
||||
|
||||
@@ -22,11 +22,11 @@ use bytes::Bytes;
|
||||
|
||||
/// Ethereum seal.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Ethereum {
|
||||
/// Seal nonce.
|
||||
pub nonce: H64,
|
||||
/// Seal mix hash.
|
||||
#[serde(rename="mixHash")]
|
||||
pub mix_hash: H256,
|
||||
}
|
||||
|
||||
@@ -52,18 +52,15 @@ pub struct TendermintSeal {
|
||||
|
||||
/// Seal variants.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum Seal {
|
||||
/// Ethereum seal.
|
||||
#[serde(rename="ethereum")]
|
||||
Ethereum(Ethereum),
|
||||
/// AuthorityRound seal.
|
||||
#[serde(rename="authorityRound")]
|
||||
AuthorityRound(AuthorityRoundSeal),
|
||||
/// Tendermint seal.
|
||||
#[serde(rename="tendermint")]
|
||||
Tendermint(TendermintSeal),
|
||||
/// Generic seal.
|
||||
#[serde(rename="generic")]
|
||||
Generic(Bytes),
|
||||
}
|
||||
|
||||
|
||||
@@ -38,11 +38,11 @@ pub enum ForkSpec {
|
||||
|
||||
/// Spec deserialization.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Spec {
|
||||
/// Spec name.
|
||||
pub name: String,
|
||||
/// Special fork name.
|
||||
#[serde(rename="dataDir")]
|
||||
pub data_dir: Option<String>,
|
||||
/// Engine.
|
||||
pub engine: Engine,
|
||||
@@ -55,7 +55,6 @@ pub struct Spec {
|
||||
/// Boot nodes.
|
||||
pub nodes: Option<Vec<String>>,
|
||||
/// Hardcoded synchronization for the light client.
|
||||
#[serde(rename="hardcodedSync")]
|
||||
pub hardcoded_sync: Option<HardcodedSync>,
|
||||
}
|
||||
|
||||
|
||||
@@ -21,23 +21,19 @@ use super::ValidatorSet;
|
||||
|
||||
/// Tendermint params deserialization.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct TendermintParams {
|
||||
/// Valid validators.
|
||||
pub validators: ValidatorSet,
|
||||
/// Propose step timeout in milliseconds.
|
||||
#[serde(rename="timeoutPropose")]
|
||||
pub timeout_propose: Option<Uint>,
|
||||
/// Prevote step timeout in milliseconds.
|
||||
#[serde(rename="timeoutPrevote")]
|
||||
pub timeout_prevote: Option<Uint>,
|
||||
/// Precommit step timeout in milliseconds.
|
||||
#[serde(rename="timeoutPrecommit")]
|
||||
pub timeout_precommit: Option<Uint>,
|
||||
/// Commit step timeout in milliseconds.
|
||||
#[serde(rename="timeoutCommit")]
|
||||
pub timeout_commit: Option<Uint>,
|
||||
/// Reward per block.
|
||||
#[serde(rename="blockReward")]
|
||||
pub block_reward: Option<Uint>,
|
||||
}
|
||||
|
||||
|
||||
@@ -22,18 +22,15 @@ use hash::Address;
|
||||
|
||||
/// Different ways of specifying validators.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum ValidatorSet {
|
||||
/// A simple list of authorities.
|
||||
#[serde(rename="list")]
|
||||
List(Vec<Address>),
|
||||
/// Address of a contract that indicates the list of authorities.
|
||||
#[serde(rename="safeContract")]
|
||||
SafeContract(Address),
|
||||
/// Address of a contract that indicates the list of authorities and enables reporting of theor misbehaviour using transactions.
|
||||
#[serde(rename="contract")]
|
||||
Contract(Address),
|
||||
/// A map of starting blocks for each validator set.
|
||||
#[serde(rename="multi")]
|
||||
Multi(BTreeMap<Uint, ValidatorSet>),
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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>,
|
||||
|
||||
@@ -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>,
|
||||
|
||||
@@ -25,24 +25,19 @@ use uint::Uint;
|
||||
|
||||
/// Blockchain test header deserializer.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DifficultyTestCase {
|
||||
/// Parent timestamp.
|
||||
#[serde(rename="parentTimestamp")]
|
||||
pub parent_timestamp: Uint,
|
||||
/// Parent difficulty.
|
||||
#[serde(rename="parentDifficulty")]
|
||||
pub parent_difficulty: Uint,
|
||||
/// Parent uncle hash.
|
||||
#[serde(rename="parentUncles")]
|
||||
pub parent_uncles: H256,
|
||||
/// Current timestamp.
|
||||
#[serde(rename="currentTimestamp")]
|
||||
pub current_timestamp: Uint,
|
||||
/// Current difficulty.
|
||||
#[serde(rename="currentDifficulty")]
|
||||
pub current_difficulty: Uint,
|
||||
/// Current block number.
|
||||
#[serde(rename="currentBlockNumber")]
|
||||
pub current_block_number: Uint,
|
||||
}
|
||||
|
||||
|
||||
@@ -23,14 +23,13 @@ use maybe::MaybeEmpty;
|
||||
|
||||
/// Transaction 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,
|
||||
|
||||
@@ -23,7 +23,7 @@ use trie::Input;
|
||||
#[derive(Debug, Deserialize, PartialEq)]
|
||||
pub struct Trie {
|
||||
/// Trie test input.
|
||||
#[serde(rename="in")]
|
||||
#[serde(rename = "in")]
|
||||
pub input: Input,
|
||||
/// Trie root hash.
|
||||
pub root: H256,
|
||||
|
||||
@@ -23,13 +23,13 @@ use maybe::MaybeEmpty;
|
||||
|
||||
/// Vm call deserialization.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Call {
|
||||
/// Call data.
|
||||
pub data: Bytes,
|
||||
/// Call destination.
|
||||
pub destination: MaybeEmpty<Address>,
|
||||
/// Gas limit.
|
||||
#[serde(rename="gasLimit")]
|
||||
pub gas_limit: Uint,
|
||||
/// Call value.
|
||||
pub value: Uint,
|
||||
|
||||
@@ -22,19 +22,19 @@ use uint::Uint;
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
pub struct Env {
|
||||
/// Address.
|
||||
#[serde(rename="currentCoinbase")]
|
||||
#[serde(rename = "currentCoinbase")]
|
||||
pub author: Address,
|
||||
/// Difficulty
|
||||
#[serde(rename="currentDifficulty")]
|
||||
#[serde(rename = "currentDifficulty")]
|
||||
pub difficulty: Uint,
|
||||
/// Gas limit.
|
||||
#[serde(rename="currentGasLimit")]
|
||||
#[serde(rename = "currentGasLimit")]
|
||||
pub gas_limit: Uint,
|
||||
/// Number.
|
||||
#[serde(rename="currentNumber")]
|
||||
#[serde(rename = "currentNumber")]
|
||||
pub number: Uint,
|
||||
/// Timestamp.
|
||||
#[serde(rename="currentTimestamp")]
|
||||
#[serde(rename = "currentTimestamp")]
|
||||
pub timestamp: Uint,
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,12 @@ use bytes::Bytes;
|
||||
|
||||
/// Executed transaction.
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Transaction {
|
||||
/// Contract address.
|
||||
pub address: Address,
|
||||
/// Transaction sender.
|
||||
#[serde(rename="caller")]
|
||||
#[serde(rename = "caller")]
|
||||
pub sender: Address,
|
||||
/// Contract code.
|
||||
pub code: Bytes,
|
||||
@@ -34,7 +35,6 @@ pub struct Transaction {
|
||||
/// Gas.
|
||||
pub gas: Uint,
|
||||
/// Gas price.
|
||||
#[serde(rename="gasPrice")]
|
||||
pub gas_price: Uint,
|
||||
/// Transaction origin.
|
||||
pub origin: Address,
|
||||
|
||||
@@ -26,26 +26,26 @@ use vm::{Transaction, Call, Env};
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
pub struct Vm {
|
||||
/// Contract calls made internaly by executed transaction.
|
||||
#[serde(rename="callcreates")]
|
||||
#[serde(rename = "callcreates")]
|
||||
pub calls: Option<Vec<Call>>,
|
||||
/// Env info.
|
||||
pub env: Env,
|
||||
/// Executed transaction
|
||||
#[serde(rename="exec")]
|
||||
#[serde(rename = "exec")]
|
||||
pub transaction: Transaction,
|
||||
/// Gas left after transaction execution.
|
||||
#[serde(rename="gas")]
|
||||
#[serde(rename = "gas")]
|
||||
pub gas_left: Option<Uint>,
|
||||
/// Hash of logs created during execution of transaction.
|
||||
pub logs: Option<H256>,
|
||||
/// Transaction output.
|
||||
#[serde(rename="out")]
|
||||
#[serde(rename = "out")]
|
||||
pub output: Option<Bytes>,
|
||||
/// Post execution vm state.
|
||||
#[serde(rename="post")]
|
||||
#[serde(rename = "post")]
|
||||
pub post_state: Option<State>,
|
||||
/// Pre execution vm state.
|
||||
#[serde(rename="pre")]
|
||||
#[serde(rename = "pre")]
|
||||
pub pre_state: State,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user