From 46662899da1138a79dea01664a4e7fdf853c8735 Mon Sep 17 00:00:00 2001 From: keorn Date: Mon, 19 Dec 2016 14:15:39 +0100 Subject: [PATCH] make spec naming consistent --- ethcore/res/authority_round.json | 4 ++-- ethcore/res/basic_authority.json | 2 +- ethcore/res/instant_seal.json | 2 +- ethcore/res/null.json | 2 +- ethcore/res/null_morden.json | 2 +- ethcore/res/tendermint.json | 2 +- json/src/spec/engine.rs | 9 +++++++-- json/src/spec/seal.rs | 4 ++-- 8 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ethcore/res/authority_round.json b/ethcore/res/authority_round.json index efc0cdeb4..2dd38c755 100644 --- a/ethcore/res/authority_round.json +++ b/ethcore/res/authority_round.json @@ -1,7 +1,7 @@ { "name": "TestAuthorityRound", "engine": { - "AuthorityRound": { + "authorityRound": { "params": { "gasLimitBoundDivisor": "0x0400", "stepDuration": 1, @@ -21,7 +21,7 @@ }, "genesis": { "seal": { - "authority_round": { + "authorityRound": { "step": "0x0", "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" } diff --git a/ethcore/res/basic_authority.json b/ethcore/res/basic_authority.json index db4374160..623590bfa 100644 --- a/ethcore/res/basic_authority.json +++ b/ethcore/res/basic_authority.json @@ -1,7 +1,7 @@ { "name": "TestBasicAuthority", "engine": { - "BasicAuthority": { + "basicAuthority": { "params": { "gasLimitBoundDivisor": "0x0400", "durationLimit": "0x0d", diff --git a/ethcore/res/instant_seal.json b/ethcore/res/instant_seal.json index 6a3964e89..b2d119883 100644 --- a/ethcore/res/instant_seal.json +++ b/ethcore/res/instant_seal.json @@ -1,7 +1,7 @@ { "name": "DevelopmentChain", "engine": { - "InstantSeal": null + "instantSeal": null }, "params": { "accountStartNonce": "0x0", diff --git a/ethcore/res/null.json b/ethcore/res/null.json index b9b2b1260..3ec7ce75e 100644 --- a/ethcore/res/null.json +++ b/ethcore/res/null.json @@ -1,7 +1,7 @@ { "name": "Morden", "engine": { - "Null": null + "null": null }, "params": { "accountStartNonce": "0x0", diff --git a/ethcore/res/null_morden.json b/ethcore/res/null_morden.json index 9b792934a..96d804b5b 100644 --- a/ethcore/res/null_morden.json +++ b/ethcore/res/null_morden.json @@ -1,7 +1,7 @@ { "name": "Morden", "engine": { - "Null": null + "null": null }, "params": { "accountStartNonce": "0x0", diff --git a/ethcore/res/tendermint.json b/ethcore/res/tendermint.json index 778757107..da62448e5 100644 --- a/ethcore/res/tendermint.json +++ b/ethcore/res/tendermint.json @@ -1,7 +1,7 @@ { "name": "TestBFT", "engine": { - "Tendermint": { + "tendermint": { "params": { "gasLimitBoundDivisor": "0x0400", "authorities" : [ diff --git a/json/src/spec/engine.rs b/json/src/spec/engine.rs index c95693b5e..b0c34b2ea 100644 --- a/json/src/spec/engine.rs +++ b/json/src/spec/engine.rs @@ -25,16 +25,21 @@ use spec::Tendermint; #[derive(Debug, PartialEq, Deserialize)] pub enum Engine { /// Null engine. + #[serde(rename="null")] Null, /// Instantly sealing engine. + #[serde(rename="instantSeal")] InstantSeal, /// Ethash engine. Ethash(Ethash), /// BasicAuthority engine. + #[serde(rename="basicAuthority")] BasicAuthority(BasicAuthority), /// AuthorityRound engine. + #[serde(rename="authorityRound")] AuthorityRound(AuthorityRound), /// Tendermint engine. + #[serde(rename="tendermint")] Tendermint(Tendermint) } @@ -46,14 +51,14 @@ mod tests { #[test] fn engine_deserialization() { let s = r#"{ - "Null": null + "null": null }"#; let deserialized: Engine = serde_json::from_str(s).unwrap(); assert_eq!(Engine::Null, deserialized); let s = r#"{ - "InstantSeal": null + "instantSeal": null }"#; let deserialized: Engine = serde_json::from_str(s).unwrap(); diff --git a/json/src/spec/seal.rs b/json/src/spec/seal.rs index 1cf1e86e6..2f4e31722 100644 --- a/json/src/spec/seal.rs +++ b/json/src/spec/seal.rs @@ -57,7 +57,7 @@ pub enum Seal { #[serde(rename="ethereum")] Ethereum(Ethereum), /// AuthorityRound seal. - #[serde(rename="authority_round")] + #[serde(rename="authorityRound")] AuthorityRound(AuthorityRoundSeal), /// Tendermint seal. #[serde(rename="tendermint")] @@ -82,7 +82,7 @@ mod tests { },{ "generic": "0xe011bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa" },{ - "authority_round": { + "authorityRound": { "step": "0x0", "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" }