Trait sp_consensus_pow::DifficultyApi
source · pub trait DifficultyApi<Block: BlockT, Difficulty: Decode>: Core<Block> {
// Provided method
fn difficulty(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Difficulty, ApiError> { ... }
}
Expand description
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§
sourcefn difficulty(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Difficulty, ApiError>
fn difficulty( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Difficulty, ApiError>
Return the target difficulty of the next block.