2016-01-08 12:15:59 +01:00
|
|
|
use engine::Engine;
|
|
|
|
use spec::Spec;
|
|
|
|
use evm_schedule::EvmSchedule;
|
|
|
|
use env_info::EnvInfo;
|
|
|
|
|
|
|
|
/// Engine using Ethash proof-of-work consensus algorithm, suitable for Ethereum
|
|
|
|
/// mainnet chains in the Olympic, Frontier and Homestead eras.
|
|
|
|
pub struct Ethash {
|
|
|
|
spec: Spec,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Ethash {
|
|
|
|
pub fn new_boxed(spec: Spec) -> Box<Engine> {
|
2016-01-08 12:27:00 +01:00
|
|
|
Box::new(Ethash{spec: spec})
|
2016-01-08 12:15:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-08 12:27:00 +01:00
|
|
|
impl Engine for Ethash {
|
2016-01-08 12:15:59 +01:00
|
|
|
fn name(&self) -> &str { "Ethash" }
|
|
|
|
fn spec(&self) -> &Spec { &self.spec }
|
|
|
|
fn evm_schedule(&self, _env_info: &EnvInfo) -> EvmSchedule { EvmSchedule::new_frontier() }
|
|
|
|
}
|