pub trait SubspaceApi<Block: BlockT, RewardAddress: Encode + Decode>: Core<Block> {
// Provided methods
fn pot_parameters(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<PotParameters, ApiError> { ... }
fn solution_ranges(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<SolutionRanges, ApiError> { ... }
fn submit_vote_extrinsic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
signed_vote: SignedVote<<<Block as BlockT>::Header as HeaderT>::Number, Block::Hash, RewardAddress>,
) -> Result<(), ApiError> { ... }
fn history_size(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<HistorySize, ApiError> { ... }
fn max_pieces_in_sector(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u16, ApiError> { ... }
fn segment_commitment(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
segment_index: SegmentIndex,
) -> Result<Option<SegmentCommitment>, ApiError> { ... }
fn extract_segment_headers(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
ext: &Block::Extrinsic,
) -> Result<Option<Vec<SegmentHeader>>, ApiError> { ... }
fn is_inherent(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
ext: &Block::Extrinsic,
) -> Result<bool, ApiError> { ... }
fn root_plot_public_key(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<PublicKey>, ApiError> { ... }
fn should_adjust_solution_range(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<bool, ApiError> { ... }
fn chain_constants(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<ChainConstants, ApiError> { ... }
}
Expand description
API necessary for block authorship with Subspace.
Provided Methods§
sourcefn pot_parameters(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<PotParameters, ApiError>
fn pot_parameters( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<PotParameters, ApiError>
Proof of time parameters
sourcefn solution_ranges(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<SolutionRanges, ApiError>
fn solution_ranges( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<SolutionRanges, ApiError>
Solution ranges.
sourcefn submit_vote_extrinsic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
signed_vote: SignedVote<<<Block as BlockT>::Header as HeaderT>::Number, Block::Hash, RewardAddress>,
) -> Result<(), ApiError>
fn submit_vote_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, signed_vote: SignedVote<<<Block as BlockT>::Header as HeaderT>::Number, Block::Hash, RewardAddress>, ) -> Result<(), ApiError>
Submit farmer vote vote that is essentially a header with bigger solution range than acceptable for block authoring. Only useful in an offchain context.
sourcefn history_size(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<HistorySize, ApiError>
fn history_size( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<HistorySize, ApiError>
Size of the blockchain history
sourcefn max_pieces_in_sector(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u16, ApiError>
fn max_pieces_in_sector( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<u16, ApiError>
How many pieces one sector is supposed to contain (max)
sourcefn segment_commitment(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
segment_index: SegmentIndex,
) -> Result<Option<SegmentCommitment>, ApiError>
fn segment_commitment( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, segment_index: SegmentIndex, ) -> Result<Option<SegmentCommitment>, ApiError>
Get the segment commitment of records for specified segment index
sourcefn extract_segment_headers(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
ext: &Block::Extrinsic,
) -> Result<Option<Vec<SegmentHeader>>, ApiError>
fn extract_segment_headers( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ext: &Block::Extrinsic, ) -> Result<Option<Vec<SegmentHeader>>, ApiError>
Returns Vec<SegmentHeader>
if a given extrinsic has them.
sourcefn is_inherent(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
ext: &Block::Extrinsic,
) -> Result<bool, ApiError>
fn is_inherent( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ext: &Block::Extrinsic, ) -> Result<bool, ApiError>
Checks if the extrinsic is an inherent.
sourcefn root_plot_public_key(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<PublicKey>, ApiError>
fn root_plot_public_key( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Option<PublicKey>, ApiError>
Returns root plot public key in case block authoring is restricted.
sourcefn should_adjust_solution_range(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<bool, ApiError>
fn should_adjust_solution_range( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<bool, ApiError>
Whether solution range adjustment is enabled.
sourcefn chain_constants(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<ChainConstants, ApiError>
fn chain_constants( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<ChainConstants, ApiError>
Get Subspace blockchain constants