Merge pull request #3895 from ethcore/rename-engines

Consistent engine and seal names
This commit is contained in:
Gav Wood 2016-12-19 15:19:57 +01:00 committed by GitHub
commit 9e3cadc6c3
8 changed files with 16 additions and 11 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "TestAuthorityRound", "name": "TestAuthorityRound",
"engine": { "engine": {
"AuthorityRound": { "authorityRound": {
"params": { "params": {
"gasLimitBoundDivisor": "0x0400", "gasLimitBoundDivisor": "0x0400",
"stepDuration": 1, "stepDuration": 1,
@ -21,7 +21,7 @@
}, },
"genesis": { "genesis": {
"seal": { "seal": {
"authority_round": { "authorityRound": {
"step": "0x0", "step": "0x0",
"signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
} }

View File

@ -1,7 +1,7 @@
{ {
"name": "TestBasicAuthority", "name": "TestBasicAuthority",
"engine": { "engine": {
"BasicAuthority": { "basicAuthority": {
"params": { "params": {
"gasLimitBoundDivisor": "0x0400", "gasLimitBoundDivisor": "0x0400",
"durationLimit": "0x0d", "durationLimit": "0x0d",

View File

@ -1,7 +1,7 @@
{ {
"name": "DevelopmentChain", "name": "DevelopmentChain",
"engine": { "engine": {
"InstantSeal": null "instantSeal": null
}, },
"params": { "params": {
"accountStartNonce": "0x0", "accountStartNonce": "0x0",

View File

@ -1,7 +1,7 @@
{ {
"name": "Morden", "name": "Morden",
"engine": { "engine": {
"Null": null "null": null
}, },
"params": { "params": {
"accountStartNonce": "0x0", "accountStartNonce": "0x0",

View File

@ -1,7 +1,7 @@
{ {
"name": "Morden", "name": "Morden",
"engine": { "engine": {
"Null": null "null": null
}, },
"params": { "params": {
"accountStartNonce": "0x0", "accountStartNonce": "0x0",

View File

@ -1,7 +1,7 @@
{ {
"name": "TestBFT", "name": "TestBFT",
"engine": { "engine": {
"Tendermint": { "tendermint": {
"params": { "params": {
"gasLimitBoundDivisor": "0x0400", "gasLimitBoundDivisor": "0x0400",
"authorities" : [ "authorities" : [

View File

@ -25,16 +25,21 @@ use spec::Tendermint;
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
pub enum Engine { pub enum Engine {
/// Null engine. /// Null engine.
#[serde(rename="null")]
Null, Null,
/// Instantly sealing engine. /// Instantly sealing engine.
#[serde(rename="instantSeal")]
InstantSeal, InstantSeal,
/// Ethash engine. /// Ethash engine.
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)
} }
@ -46,14 +51,14 @@ mod tests {
#[test] #[test]
fn engine_deserialization() { fn engine_deserialization() {
let s = r#"{ let s = r#"{
"Null": null "null": null
}"#; }"#;
let deserialized: Engine = serde_json::from_str(s).unwrap(); let deserialized: Engine = serde_json::from_str(s).unwrap();
assert_eq!(Engine::Null, deserialized); assert_eq!(Engine::Null, deserialized);
let s = r#"{ let s = r#"{
"InstantSeal": null "instantSeal": null
}"#; }"#;
let deserialized: Engine = serde_json::from_str(s).unwrap(); let deserialized: Engine = serde_json::from_str(s).unwrap();

View File

@ -57,7 +57,7 @@ pub enum Seal {
#[serde(rename="ethereum")] #[serde(rename="ethereum")]
Ethereum(Ethereum), Ethereum(Ethereum),
/// AuthorityRound seal. /// AuthorityRound seal.
#[serde(rename="authority_round")] #[serde(rename="authorityRound")]
AuthorityRound(AuthorityRoundSeal), AuthorityRound(AuthorityRoundSeal),
/// Tendermint seal. /// Tendermint seal.
#[serde(rename="tendermint")] #[serde(rename="tendermint")]
@ -82,7 +82,7 @@ mod tests {
},{ },{
"generic": "0xe011bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa" "generic": "0xe011bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"
},{ },{
"authority_round": { "authorityRound": {
"step": "0x0", "step": "0x0",
"signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
} }