Support millisecond timestamp for instant seal engine (#9469)

* Support millisecond timestamp for instant seal engine

* Forgot to checkin instant_seal mod

* Fix instant seal config

* Fix json crate compile

* Fix private_spec.json

* Option<bool> -> bool
This commit is contained in:
Wei Tang
2018-09-06 17:38:00 +08:00
committed by Andronik Ordian
parent 39a12622ae
commit 5752869824
7 changed files with 71 additions and 12 deletions

View File

@@ -16,7 +16,7 @@
//! Engine deserialization.
use super::{Ethash, BasicAuthority, AuthorityRound, Tendermint, NullEngine};
use super::{Ethash, BasicAuthority, AuthorityRound, Tendermint, NullEngine, InstantSeal};
/// Engine deserialization.
#[derive(Debug, PartialEq, Deserialize)]
@@ -26,7 +26,7 @@ pub enum Engine {
Null(NullEngine),
/// Instantly sealing engine.
#[serde(rename="instantSeal")]
InstantSeal,
InstantSeal(InstantSeal),
/// Ethash engine.
Ethash(Ethash),
/// BasicAuthority engine.
@@ -62,12 +62,12 @@ mod tests {
}
let s = r#"{
"instantSeal": null
"instantSeal": {"params": {}}
}"#;
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.
_ => panic!(),
};