referrerpolicy=no-referrer-when-downgrade

Module apis

Source
Expand description

Types and traits for runtimes that implement runtime APIs.

A testing runtime should not need this.

A non-testing runtime should have this enabled, as such:

use polkadot_sdk_frame::runtime::{prelude::*, apis::{*,}};

Re-exports§

pub use sp_api;

Modules§

digests
Aura (Authority-Round) digests
ed25519
inherents
sr25519

Macros§

_frame_metadata_enabled
_std_disabled
_std_enabled
decl_runtime_apis
frame_metadata_enabled
impl_runtime_apis
mock_impl_runtime_apis
std_disabled
std_enabled

Structs§

ApiRef
Auxiliary wrapper that holds an api instance and binds it to the given lifetime.
CallApiAtParams
Parameters for CallApiAt::call_api_at.
EquivocationProof
Proof of voter misbehavior on a given set id. Misbehavior/equivocation in GRANDPA happens when a voter votes on the same round (either at prevote or precommit stage) for different blocks. Proving is achieved by collecting the signed messages of conflicting votes.
GrandpaJustification
A GRANDPA justification for block finality, it includes a commit message and an ancestry proof including all headers routing all precommit target blocks to the commit target block. Due to the current voting strategy the precommit targets should be the same as the commit target, since honest voters don’t vote past authority set change blocks.
KeyTypeId
An identifier for a type of cryptographic key.
ScheduledChange
A scheduled change of authority set.
Slot
Unit type wrapper that represents a slot.
SlotDuration
A slot duration defined in milliseconds.
StorageProof
A proof that some set of key-value pairs are included in the storage trie. The proof contains the storage values so that the partial storage backend can be reconstructed by a verifier that does not already have access to the key-value pairs.

Enums§

ApiError
An error describing which API call failed.
CallContext
The context in which a call is done.
CheckInherentsError
Errors that occur when creating and checking on the client side.
Equivocation
Wrapper object for GRANDPA equivocation proofs, useful for unifying prevote and precommit equivocations under a common type.
TransactionOutcome
Describes on what should happen with a storage transaction.

Constants§

AURA_ENGINE_ID
The ConsensusEngineId of AuRa.
CLIENT_LOG_TARGET
The log target to be used by client code.
DEV_RUNTIME_PRESET
The default development preset used to communicate with the runtime via GenesisBuilder interface.
GRANDPA_ENGINE_ID
The ConsensusEngineId of GRANDPA.
KEY_TYPE
Key type for GRANDPA module.
LOCAL_TESTNET_RUNTIME_PRESET
The default local_testnet preset used to communicate with the runtime via GenesisBuilder interface.
RUNTIME_API_INFO_SIZE
The number of bytes required to encode a RuntimeApiInfo.
RUNTIME_LOG_TARGET
The log target to be used by runtime code.
STORAGE_PREFIX
Persistent storage prefix used by the Offchain Worker API when creating a DB key.

Traits§

AccountNonceApi
The API to query account nonce.
ApiExt
Extends the runtime api implementation with some common functionality.
AuraApi
API necessary for block authorship with aura.
BlockBuilder
The BlockBuilder api trait that provides the required functionality for building a block.
CallApiAt
Something that can call into an api at a given block.
ConstructRuntimeApi
Something that can be constructed to a runtime api.
Core
The Core runtime api that every Substrate runtime needs to implement.
GenesisBuilder
API to interact with RuntimeGenesisConfig for the runtime
GrandpaApi
APIs for integrating the GRANDPA finality gadget into runtimes. This should be implemented on the runtime side.
Metadata
The Metadata api trait that returns metadata for the runtime.
OffchainWorkerApi
The offchain worker api.
ProvideRuntimeApi
Something that provides a runtime api.
RuntimeApiInfo
Something that provides information about a runtime api.
SessionKeys
Session keys runtime api.
TaggedTransactionQueue
The TaggedTransactionQueue api trait for interfering with the transaction queue.

Functions§

check_equivocation_proof
Verifies the equivocation proof by making sure that both votes target different blocks and that its signatures are valid.
check_inherents
Create inherent data and check that the inherents are valid.
check_inherents_with_data
Check that the inherents are valid.
check_message_signature
Check a message signature by encoding the message as a localized payload and verifying the provided signature using the expected authority id.
check_message_signature_with_buffer
Check a message signature by encoding the message as a localized payload and verifying the provided signature using the expected authority id. The encoding necessary to verify the signature will be done using the given buffer, the original content of the buffer will be cleared.
deserialize_runtime_api_info
Deserialize the runtime API info serialized by serialize_runtime_api_info.
init_runtime_logger
Init the RuntimeLogger.
localized_payload
Encode round message localized to a given round and set id.
localized_payload_with_buffer
Encode round message localized to a given round and set id using the given buffer. The given buffer will be cleared and the resulting encoded payload will always be written to the start of the buffer.
serialize_runtime_api_info
Crude and simple way to serialize the RuntimeApiInfo into a bunch of bytes.
sign_message
Localizes the message to the given set and round and signs the payload.

Type Aliases§

AuthorityId
Identity of a Grandpa authority.
AuthorityList
A list of Grandpa authorities with associated weights.
AuthorityPair
The grandpa crypto scheme defined via the keypair type.
AuthoritySignature
Signature for a Grandpa authority.
AuthorityWeight
The weight of an authority.
CatchUp
A catch up message for this chain’s block type.
Commit
A commit message for this chain’s block type.
CompactCommit
A compact commit message for this chain’s block type.
Message
A GRANDPA message for a substrate chain.
OpaqueKeyOwnershipProof
An opaque type used to represent the key ownership proof at the runtime API boundary. The inner value is an encoded representation of the actual key ownership proof which will be parameterized when defining the runtime. At the runtime API boundary this type is unknown and as such we keep this opaque representation, implementors of the runtime API will have to make sure that all usages of OpaqueKeyOwnershipProof refer to the same type.
Precommit
A precommit message for this chain’s block type.
PresetId
The type representing preset ID.
Prevote
A prevote message for this chain’s block type.
PrimaryPropose
A primary propose message for this chain’s block type.
ProofRecorder
A type that records all accessed trie nodes and generates a proof out of it.
Result
The result type alias, used in build methods. Err contains formatted error message.
RoundNumber
The round indicator.
SetId
The monotonic identifier of a GRANDPA set of authorities.
SignedMessage
A signed message.
StorageChanges