Trait sc_consensus_babe::BabeApi[][src]

pub trait BabeApi<Block>: Core<Block> where
    Block: Block
{ pub fn configuration(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<BabeGenesisConfiguration, Self::Error> { ... }
pub fn configuration_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<BabeGenesisConfiguration, Self::Error> { ... }
pub fn configuration_before_version_2(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<BabeGenesisConfigurationV1, Self::Error> { ... }
pub fn configuration_before_version_2_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<BabeGenesisConfigurationV1, Self::Error> { ... }
pub fn current_epoch_start(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<Slot, Self::Error> { ... }
pub fn current_epoch_start_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<Slot, Self::Error> { ... }
pub fn current_epoch(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<Epoch, Self::Error> { ... }
pub fn current_epoch_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<Epoch, Self::Error> { ... }
pub fn next_epoch(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<Epoch, Self::Error> { ... }
pub fn next_epoch_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<Epoch, Self::Error> { ... }
pub fn generate_key_ownership_proof(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        slot: Slot,
        authority_id: Public
    ) -> Result<Option<OpaqueKeyOwnershipProof>, Self::Error> { ... }
pub fn generate_key_ownership_proof_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        slot: Slot,
        authority_id: Public
    ) -> Result<Option<OpaqueKeyOwnershipProof>, Self::Error> { ... }
pub fn submit_report_equivocation_unsigned_extrinsic(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        equivocation_proof: EquivocationProof<<Block as Block>::Header, Public>,
        key_owner_proof: OpaqueKeyOwnershipProof
    ) -> Result<Option<()>, Self::Error> { ... }
pub fn submit_report_equivocation_unsigned_extrinsic_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        equivocation_proof: EquivocationProof<<Block as Block>::Header, Public>,
        key_owner_proof: OpaqueKeyOwnershipProof
    ) -> Result<Option<()>, Self::Error> { ... } }

API necessary for block authorship with BABE.

Provided methods

pub fn configuration(
    &self,
    __runtime_api_at_param__: &BlockId<Block>
) -> Result<BabeGenesisConfiguration, Self::Error>
[src]

Return the genesis configuration for BABE. The configuration is only read on genesis.

pub fn configuration_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext
) -> Result<BabeGenesisConfiguration, Self::Error>
[src]

Return the genesis configuration for BABE. The configuration is only read on genesis.

pub fn configuration_before_version_2(
    &self,
    __runtime_api_at_param__: &BlockId<Block>
) -> Result<BabeGenesisConfigurationV1, Self::Error>
[src]

👎 Deprecated

Return the configuration for BABE. Version 1.

pub fn configuration_before_version_2_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext
) -> Result<BabeGenesisConfigurationV1, Self::Error>
[src]

👎 Deprecated

Return the configuration for BABE. Version 1.

pub fn current_epoch_start(
    &self,
    __runtime_api_at_param__: &BlockId<Block>
) -> Result<Slot, Self::Error>
[src]

Returns the slot that started the current epoch.

pub fn current_epoch_start_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext
) -> Result<Slot, Self::Error>
[src]

Returns the slot that started the current epoch.

pub fn current_epoch(
    &self,
    __runtime_api_at_param__: &BlockId<Block>
) -> Result<Epoch, Self::Error>
[src]

Returns information regarding the current epoch.

pub fn current_epoch_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext
) -> Result<Epoch, Self::Error>
[src]

Returns information regarding the current epoch.

pub fn next_epoch(
    &self,
    __runtime_api_at_param__: &BlockId<Block>
) -> Result<Epoch, Self::Error>
[src]

Returns information regarding the next epoch (which was already previously announced).

pub fn next_epoch_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext
) -> Result<Epoch, Self::Error>
[src]

Returns information regarding the next epoch (which was already previously announced).

pub fn generate_key_ownership_proof(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    slot: Slot,
    authority_id: Public
) -> Result<Option<OpaqueKeyOwnershipProof>, Self::Error>
[src]

Generates a proof of key ownership for the given authority in the current epoch. An example usage of this module is coupled with the session historical module to prove that a given authority key is tied to a given staking identity during a specific session. Proofs of key ownership are necessary for submitting equivocation reports. NOTE: even though the API takes a slot as parameter the current implementations ignores this parameter and instead relies on this method being called at the correct block height, i.e. any point at which the epoch for the given slot is live on-chain. Future implementations will instead use indexed data through an offchain worker, not requiring older states to be available.

pub fn generate_key_ownership_proof_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext,
    slot: Slot,
    authority_id: Public
) -> Result<Option<OpaqueKeyOwnershipProof>, Self::Error>
[src]

Generates a proof of key ownership for the given authority in the current epoch. An example usage of this module is coupled with the session historical module to prove that a given authority key is tied to a given staking identity during a specific session. Proofs of key ownership are necessary for submitting equivocation reports. NOTE: even though the API takes a slot as parameter the current implementations ignores this parameter and instead relies on this method being called at the correct block height, i.e. any point at which the epoch for the given slot is live on-chain. Future implementations will instead use indexed data through an offchain worker, not requiring older states to be available.

pub fn submit_report_equivocation_unsigned_extrinsic(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    equivocation_proof: EquivocationProof<<Block as Block>::Header, Public>,
    key_owner_proof: OpaqueKeyOwnershipProof
) -> Result<Option<()>, Self::Error>
[src]

Submits an unsigned extrinsic to report an equivocation. The caller must provide the equivocation proof and a key ownership proof (should be obtained using generate_key_ownership_proof). The extrinsic will be unsigned and should only be accepted for local authorship (not to be broadcast to the network). This method returns None when creation of the extrinsic fails, e.g. if equivocation reporting is disabled for the given runtime (i.e. this method is hardcoded to return None). Only useful in an offchain context.

pub fn submit_report_equivocation_unsigned_extrinsic_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext,
    equivocation_proof: EquivocationProof<<Block as Block>::Header, Public>,
    key_owner_proof: OpaqueKeyOwnershipProof
) -> Result<Option<()>, Self::Error>
[src]

Submits an unsigned extrinsic to report an equivocation. The caller must provide the equivocation proof and a key ownership proof (should be obtained using generate_key_ownership_proof). The extrinsic will be unsigned and should only be accepted for local authorship (not to be broadcast to the network). This method returns None when creation of the extrinsic fails, e.g. if equivocation reporting is disabled for the given runtime (i.e. this method is hardcoded to return None). Only useful in an offchain context.

Loading content...

Trait Implementations

impl<Block, __Sr_Api_Error__> RuntimeApiInfo for dyn BabeApi<Block, Error = __Sr_Api_Error__> + 'static where
    Block: Block
[src]

Implementors

Loading content...