[][src]Trait sp_consensus_pow::DifficultyApi

pub trait DifficultyApi<Block: BlockT, Difficulty: Decode>: Core<Block> {
    fn difficulty(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<Difficulty, Self::Error> { ... }
fn difficulty_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<Difficulty, Self::Error> { ... } }

API for those chains that put their difficulty adjustment algorithm directly onto runtime. Note that while putting difficulty adjustment algorithm to runtime is safe, putting the PoW algorithm on runtime is not.

Provided methods

fn difficulty(
    &self,
    __runtime_api_at_param__: &BlockId<Block>
) -> Result<Difficulty, Self::Error>

Return the target difficulty of the next block.

fn difficulty_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext
) -> Result<Difficulty, Self::Error>

Return the target difficulty of the next block.

Loading content...

Trait Implementations

impl<Block: BlockT, Difficulty: Decode, __Sr_Api_Error__> RuntimeApiInfo for dyn DifficultyApi<Block, Difficulty, Error = __Sr_Api_Error__>[src]

Implementors

Loading content...