Instant sealing engine (#1767)

* add an instant sealing engine

* add sealing engine tests

* rename to InstantSeal

* update name in json

* whitespace

[ci:skip]
This commit is contained in:
keorn
2016-07-30 23:42:31 +02:00
committed by Gav Wood
parent 53f1d7b6ff
commit b672d51a74
6 changed files with 158 additions and 4 deletions

View File

@@ -17,7 +17,7 @@
//! Parameters for a block chain.
use common::*;
use engines::{Engine, NullEngine, BasicAuthority};
use engines::{Engine, NullEngine, InstantSeal, BasicAuthority};
use pod_state::*;
use account_db::*;
use super::genesis::Genesis;
@@ -133,6 +133,7 @@ impl Spec {
fn engine(engine_spec: ethjson::spec::Engine, params: CommonParams, builtins: BTreeMap<Address, Builtin>) -> Box<Engine> {
match engine_spec {
ethjson::spec::Engine::Null => Box::new(NullEngine::new(params, builtins)),
ethjson::spec::Engine::InstantSeal => Box::new(InstantSeal::new(params, builtins)),
ethjson::spec::Engine::Ethash(ethash) => Box::new(ethereum::Ethash::new(params, From::from(ethash.params), builtins)),
ethjson::spec::Engine::BasicAuthority(basic_authority) => Box::new(BasicAuthority::new(params, From::from(basic_authority.params), builtins)),
}