Move more params to the common section. (#6134)

* move common forks and parameters to common params

* port specs over to new format

* fix RPC tests
This commit is contained in:
Robert Habermeier
2017-07-31 12:34:29 +02:00
committed by Gav Wood
parent 9c5ef1f776
commit 003eef982b
55 changed files with 224 additions and 358 deletions

View File

@@ -16,7 +16,7 @@
//! Engine deserialization.
use super::{Ethash, InstantSeal, BasicAuthority, AuthorityRound, Tendermint};
use super::{Ethash, BasicAuthority, AuthorityRound, Tendermint};
/// Engine deserialization.
#[derive(Debug, PartialEq, Deserialize)]
@@ -26,7 +26,7 @@ pub enum Engine {
Null,
/// Instantly sealing engine.
#[serde(rename="instantSeal")]
InstantSeal(InstantSeal),
InstantSeal,
/// Ethash engine.
Ethash(Ethash),
/// BasicAuthority engine.
@@ -55,23 +55,21 @@ mod tests {
assert_eq!(Engine::Null, deserialized);
let s = r#"{
"instantSeal": { "params": {} }
"instantSeal": null
}"#;
let deserialized: Engine = serde_json::from_str(s).unwrap();
match deserialized {
Engine::InstantSeal(_) => {}, // instant seal is unit tested in its own file.
Engine::InstantSeal => {}, // instant seal is unit tested in its own file.
_ => assert!(false),
};
let s = r#"{
"Ethash": {
"params": {
"gasLimitBoundDivisor": "0x0400",
"minimumDifficulty": "0x020000",
"difficultyBoundDivisor": "0x0800",
"durationLimit": "0x0d",
"blockReward": "0x4563918244F40000",
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
"homesteadTransition" : "0x",
"daoHardforkTransition": "0xffffffffffffffff",
@@ -90,7 +88,6 @@ mod tests {
let s = r#"{
"basicAuthority": {
"params": {
"gasLimitBoundDivisor": "0x0400",
"durationLimit": "0x0d",
"validators" : {
"list": ["0xc6d9d2cd449a754c494264e1809c50e34d64562b"]
@@ -107,14 +104,11 @@ mod tests {
let s = r#"{
"authorityRound": {
"params": {
"gasLimitBoundDivisor": "0x0400",
"stepDuration": "0x02",
"validators": {
"list" : ["0xc6d9d2cd449a754c494264e1809c50e34d64562b"]
},
"blockReward": "0x50",
"startStep" : 24,
"eip155Transition": "0x42",
"validateStepTransition": 150
}
}
@@ -128,11 +122,9 @@ mod tests {
let s = r#"{
"tendermint": {
"params": {
"gasLimitBoundDivisor": "0x0400",
"validators": {
"list": ["0xc6d9d2cd449a754c494264e1809c50e34d64562b"]
},
"blockReward": "0x50"
}
}
}
}"#;