spec loading cleanup (#858)

* spec loading cleanup in progress

* changed engine field in json spec

* refactored engine params

* polishing spec loading refactor

* fixed compiling json tests

* fixed compiling parity

* removed warnings

* removed commented out code

* fixed failing test

* bringing back removed TODO in spec.
This commit is contained in:
Marek Kotewicz
2016-04-09 19:20:35 +02:00
committed by Gav Wood
parent d823fd7685
commit 373284ca0a
46 changed files with 957 additions and 704 deletions

View File

@@ -17,27 +17,15 @@
//! Spec genesis deserialization.
use uint::Uint;
use hash::{H64, Address, H256};
use hash::{Address, H256};
use bytes::Bytes;
use spec::Seal;
/// Spec genesis.
#[derive(Debug, PartialEq, Deserialize)]
pub struct Genesis {
// old seal
/// Seal nonce.
pub nonce: Option<H64>,
#[serde(rename="mixHash")]
/// Seal mix hash.
pub mix_hash: Option<H256>,
// new seal // TODO: consider moving it to a separate seal structure
#[serde(rename="sealFields")]
/// Number of seal fields.
pub seal_fields: Option<usize>,
#[serde(rename="sealRlp")]
/// Seal rlp.
pub seal_rlp: Option<Bytes>,
/// Seal.
pub seal: Seal,
/// Difficulty.
pub difficulty: Uint,
/// Block author.
@@ -77,7 +65,12 @@ mod tests {
let s = r#"{
"nonce": "0x0000000000000042",
"difficulty": "0x400000000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"seal": {
"ethereum": {
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x00006d6f7264656e"
}
},
"author": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",