make spec naming consistent

This commit is contained in:
keorn
2016-12-19 14:15:39 +01:00
parent 14a9942d14
commit 46662899da
8 changed files with 16 additions and 11 deletions

View File

@@ -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();