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

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

* snake_case for pricing

* Use camelcase for engine

* Use camel case for seal

* Use camel case for validator set

* Use camel case for confirmation payload

* Use camel case for consensus status

* Use camel case for nodekind

* Use kebab case for provenance

* Use camel case for pubsub

* Use lowercase and camelcase for trace

* Use camel case for whisper

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

View File

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