sp_consensus_subspace::digests

Trait CompatibleDigestItem

source
pub trait CompatibleDigestItem: Sized {
Show 18 methods // Required methods fn subspace_pre_digest<AccountId: Encode>( pre_digest: &PreDigest<AccountId>, ) -> Self; fn as_subspace_pre_digest<AccountId: Decode>( &self, ) -> Option<PreDigest<AccountId>>; fn subspace_seal(signature: RewardSignature) -> Self; fn as_subspace_seal(&self) -> Option<RewardSignature>; fn pot_slot_iterations(pot_slot_iterations: NonZeroU32) -> Self; fn as_pot_slot_iterations(&self) -> Option<NonZeroU32>; fn solution_range(solution_range: SolutionRange) -> Self; fn as_solution_range(&self) -> Option<SolutionRange>; fn pot_parameters_change(pot_parameters_change: PotParametersChange) -> Self; fn as_pot_parameters_change(&self) -> Option<PotParametersChange>; fn next_solution_range(solution_range: SolutionRange) -> Self; fn as_next_solution_range(&self) -> Option<SolutionRange>; fn segment_commitment( segment_index: SegmentIndex, segment_commitment: SegmentCommitment, ) -> Self; fn as_segment_commitment(&self) -> Option<(SegmentIndex, SegmentCommitment)>; fn enable_solution_range_adjustment_and_override( override_solution_range: Option<SolutionRange>, ) -> Self; fn as_enable_solution_range_adjustment_and_override( &self, ) -> Option<Option<SolutionRange>>; fn root_plot_public_key_update( root_plot_public_key: Option<PublicKey>, ) -> Self; fn as_root_plot_public_key_update(&self) -> Option<Option<PublicKey>>;
}
Expand description

A digest item which is usable with Subspace consensus.

Required Methods§

source

fn subspace_pre_digest<AccountId: Encode>( pre_digest: &PreDigest<AccountId>, ) -> Self

Construct a digest item which contains a Subspace pre-digest.

source

fn as_subspace_pre_digest<AccountId: Decode>( &self, ) -> Option<PreDigest<AccountId>>

If this item is an Subspace pre-digest, return it.

source

fn subspace_seal(signature: RewardSignature) -> Self

Construct a digest item which contains a Subspace seal.

source

fn as_subspace_seal(&self) -> Option<RewardSignature>

If this item is a Subspace signature, return the signature.

source

fn pot_slot_iterations(pot_slot_iterations: NonZeroU32) -> Self

Number of iterations for proof of time per slot, corresponds to slot that directly follows parent block’s slot and can change before slot for which block is produced

source

fn as_pot_slot_iterations(&self) -> Option<NonZeroU32>

If this item is a Subspace proof of time slot iterations, return it.

source

fn solution_range(solution_range: SolutionRange) -> Self

Construct a digest item which contains a solution range.

source

fn as_solution_range(&self) -> Option<SolutionRange>

If this item is a Subspace solution range, return it.

source

fn pot_parameters_change(pot_parameters_change: PotParametersChange) -> Self

Change of parameters to apply to PoT chain

source

fn as_pot_parameters_change(&self) -> Option<PotParametersChange>

If this item is a Subspace proof of time change of parameters, return it.

source

fn next_solution_range(solution_range: SolutionRange) -> Self

Construct a digest item which contains next solution range.

source

fn as_next_solution_range(&self) -> Option<SolutionRange>

If this item is a Subspace next solution range, return it.

source

fn segment_commitment( segment_index: SegmentIndex, segment_commitment: SegmentCommitment, ) -> Self

Construct a digest item which contains segment commitment.

source

fn as_segment_commitment(&self) -> Option<(SegmentIndex, SegmentCommitment)>

If this item is a Subspace segment commitment, return it.

source

fn enable_solution_range_adjustment_and_override( override_solution_range: Option<SolutionRange>, ) -> Self

Construct digest item than indicates enabling of solution range adjustment and override next solution range.

source

fn as_enable_solution_range_adjustment_and_override( &self, ) -> Option<Option<SolutionRange>>

If this item is a Subspace Enable solution range adjustment and override next solution range, return it.

source

fn root_plot_public_key_update(root_plot_public_key: Option<PublicKey>) -> Self

Construct digest item that indicates update of root plot public key.

source

fn as_root_plot_public_key_update(&self) -> Option<Option<PublicKey>>

If this item is a Subspace update of root plot public key, return it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

source§

impl CompatibleDigestItem for DigestItem

source§

fn subspace_pre_digest<RewardAddress: Encode>( pre_digest: &PreDigest<RewardAddress>, ) -> Self

source§

fn as_subspace_pre_digest<RewardAddress: Decode>( &self, ) -> Option<PreDigest<RewardAddress>>

source§

fn subspace_seal(signature: RewardSignature) -> Self

source§

fn as_subspace_seal(&self) -> Option<RewardSignature>

source§

fn pot_slot_iterations(pot_slot_iterations: NonZeroU32) -> Self

source§

fn as_pot_slot_iterations(&self) -> Option<NonZeroU32>

source§

fn solution_range(solution_range: SolutionRange) -> Self

source§

fn as_solution_range(&self) -> Option<SolutionRange>

source§

fn pot_parameters_change(pot_parameters_change: PotParametersChange) -> Self

source§

fn as_pot_parameters_change(&self) -> Option<PotParametersChange>

source§

fn next_solution_range(solution_range: SolutionRange) -> Self

source§

fn as_next_solution_range(&self) -> Option<SolutionRange>

source§

fn segment_commitment( segment_index: SegmentIndex, segment_commitment: SegmentCommitment, ) -> Self

source§

fn as_segment_commitment(&self) -> Option<(SegmentIndex, SegmentCommitment)>

source§

fn enable_solution_range_adjustment_and_override( maybe_override_solution_range: Option<SolutionRange>, ) -> Self

source§

fn as_enable_solution_range_adjustment_and_override( &self, ) -> Option<Option<SolutionRange>>

source§

fn root_plot_public_key_update(root_plot_public_key: Option<PublicKey>) -> Self

source§

fn as_root_plot_public_key_update(&self) -> Option<Option<PublicKey>>

Implementors§