use crate::runtime::ConsensusEngineId;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use codec::Decode;
pub const POW_ENGINE_ID: ConsensusEngineId = [b'p', b'o', b'w', b'_'];
pub type Seal = Vec<u8>;
pub trait TotalDifficulty {
fn increment(&mut self, other: Self);
}
impl TotalDifficulty for crate::core::U256 {
fn increment(&mut self, other: Self) {
let ret = self.saturating_add(other);
*self = ret;
}
}
impl TotalDifficulty for u128 {
fn increment(&mut self, other: Self) {
let ret = self.saturating_add(other);
*self = ret;
}
}
crate::api::decl_runtime_apis! {
pub trait TimestampApi<Moment: Decode> {
fn timestamp() -> Moment;
}
pub trait DifficultyApi<Difficulty: Decode> {
fn difficulty() -> Difficulty;
}
}