Add registrar fields (#4716)
* add registrar field * use constructor for dev registrar * fix test
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
//! Engine deserialization.
|
||||
|
||||
use super::{Ethash, BasicAuthority, AuthorityRound, Tendermint};
|
||||
use super::{Ethash, InstantSeal, 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,12 +55,10 @@ mod tests {
|
||||
assert_eq!(Engine::Null, deserialized);
|
||||
|
||||
let s = r#"{
|
||||
"instantSeal": null
|
||||
"instantSeal": { "params": {} }
|
||||
}"#;
|
||||
|
||||
let deserialized: Engine = serde_json::from_str(s).unwrap();
|
||||
assert_eq!(Engine::InstantSeal, deserialized);
|
||||
|
||||
let _deserialized: Engine = serde_json::from_str(s).unwrap();
|
||||
|
||||
let s = r#"{
|
||||
"Ethash": {
|
||||
|
||||
Reference in New Issue
Block a user