openethereum/src/ethash.rs

23 lines
574 B
Rust
Raw Normal View History

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> {
Box::new(NullEngine{spec: spec})
}
}
impl Engine for NullEngine {
fn name(&self) -> &str { "Ethash" }
fn spec(&self) -> &Spec { &self.spec }
fn evm_schedule(&self, _env_info: &EnvInfo) -> EvmSchedule { EvmSchedule::new_frontier() }
}