Documentation ¶
Index ¶
- Constants
- type Module
- func (m Module) Configuration() int64
- func (m Module) CurrentEpoch() int64
- func (m Module) CurrentEpochStart() int64
- func (m Module) GenerateKeyOwnershipProof(dataPtr int32, dataLen int32) int64
- func (m Module) Item() primitives.ApiItem
- func (m Module) Metadata() primitives.RuntimeApiMetadata
- func (m Module) Name() string
- func (m Module) NextEpoch() int64
- func (m Module) SubmitReportEquivocationUnsignedExtrinsic(dataPtr int32, dataLen int32) int64
Constants ¶
const (
ApiModuleName = "BabeApi"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module implements the BabeApi Runtime API definition, necessary for block authorship.
func (Module) Configuration ¶
Returns configuration data used by the Babe consensus engine.
func (Module) CurrentEpoch ¶
Returns information regarding the current epoch.
func (Module) CurrentEpochStart ¶
Returns the start slot of the current epoch.
func (Module) GenerateKeyOwnershipProof ¶
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.
func (Module) Item ¶
func (m Module) Item() primitives.ApiItem
Item returns the first 8 bytes of the Blake2b hash of the name and version of the api module.
func (Module) Metadata ¶
func (m Module) Metadata() primitives.RuntimeApiMetadata
Metadata returns the runtime api metadata of the module.
func (Module) NextEpoch ¶
Returns information regarding the next epoch (which was already previously announced).
func (Module) SubmitReportEquivocationUnsignedExtrinsic ¶
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.