add new dev spec

This commit is contained in:
keorn 2016-11-11 17:27:20 +00:00
parent e63b7e51fb
commit 53258cca6c
3 changed files with 5 additions and 2 deletions

View File

@ -1251,7 +1251,7 @@ mod tests {
#[test]
fn internal_seals_without_work() {
let miner = Miner::with_spec(&Spec::new_test_instant());
let miner = Miner::with_spec(&Spec::new_instant());
let c = generate_dummy_client(2);
let client = c.reference().as_ref();

View File

@ -279,7 +279,7 @@ impl Spec {
pub fn new_null() -> Spec { load_bundled!("null") }
/// Create a new Spec with InstantSeal consensus which does internal sealing (not requiring work).
pub fn new_test_instant() -> Spec { load_bundled!("instant_seal") }
pub fn new_instant() -> Spec { load_bundled!("instant_seal") }
/// Create a new Olympic chain spec.
pub fn new_ethereum_olympic() -> Spec { load_bundled!("ethereum/olympic") }

View File

@ -30,6 +30,7 @@ pub enum SpecType {
Olympic,
Classic,
Expanse,
Dev,
Custom(String),
}
@ -49,6 +50,7 @@ impl str::FromStr for SpecType {
"morden" | "testnet" => SpecType::Testnet,
"olympic" => SpecType::Olympic,
"expanse" => SpecType::Expanse,
"dev" => SpecType::Dev,
other => SpecType::Custom(other.into()),
};
Ok(spec)
@ -63,6 +65,7 @@ impl SpecType {
SpecType::Olympic => Ok(Spec::new_ethereum_olympic()),
SpecType::Classic => Ok(Spec::new_ethereum_classic()),
SpecType::Expanse => Ok(Spec::new_expanse()),
SpecType::Dev => Ok(Spec::new_instant()),
SpecType::Custom(ref filename) => {
let file = try!(fs::File::open(filename).map_err(|_| "Could not load specification file."));
Spec::load(file)