Module frame::runtime::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 frame::runtime::{prelude::*, apis::{*,}};

Re-exports

  • pub use sp_api;

Modules

Macros

Structs

  • Auxiliary wrapper that holds an api instance and binds it to the given lifetime.
  • Parameters for CallApiAt::call_api_at.
  • The result of checking inherents.
  • 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.
  • Stores extensions that should be made available through the externalities.
  • 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.
  • Inherent data to include in a block.
  • An identifier for a type of cryptographic key.
  • 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.
  • Stores the encoded RuntimeMetadata for the native side as opaque type.
  • The set of changes that are overlaid onto the backend.
  • Runtime version. This should not be thought of as classic Semver (major/minor/tiny). This triplet have different semantics and mis-interpretation could cause problems. In particular: bug fixes should result in an increment of spec_version and possibly authoring_version, absolutely not impl_version since they change the semantics of the runtime.
  • A scheduled change of authority set.
  • Unit type wrapper that represents a slot.
  • A slot duration defined in milliseconds.
  • 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.
  • Patricia trie-based backend. Transaction type is an overlay of changes to commit.
  • Builder for creating a TrieBackend.
  • An AuthorityList that is encoded with a version specifier. The encoding version is updated any time the AuthorityList type changes. This ensures that encodings of different versions of an AuthorityList are differentiable. Attempting to decode an authority list with an unknown version will fail.

Enums

  • An error describing which API call failed.
  • Something to identify a block.
  • The context in which a call is done.
  • Wrapper object for GRANDPA equivocation proofs, useful for unifying prevote and precommit equivocations under a common type.
  • A string that wraps a &'static str in the runtime and String/Vec<u8> on decode.
  • Different possible state version.
  • Describes on what should happen with a storage transaction.

Constants

Traits

  • The API to query account nonce.
  • Extends the runtime api implementation with some common functionality.
  • Something that can be converted into a TrieBackend.
  • API necessary for block authorship with aura.
  • The BlockBuilder api trait that provides the required functionality for building a block.
  • Something which fulfills the abstract idea of a Substrate block. It has types for Extrinsic pieces of information as well as a Header.
  • Something that can call into the an api at a given block.
  • Something that can be constructed to a runtime api.
  • The Core runtime api that every Substrate runtime needs to implement.
  • Trait that allows zero-copy read of value-references from slices in LE format.
  • Extension trait to Decode for decoding with a maximum recursion depth.
  • Trait that allows zero-copy write of value-references to slices in LE format.
  • Marker trait for types that should be registered as Externalities extension.
  • APIs for integrating the GRANDPA finality gadget into runtimes. This should be implemented on the runtime side.
  • Abstraction around hashing
  • Trait describing an object that can hash a slice of bytes. Used to abstract other types over the hashing algorithm. Defines a single hash method and an Out associated type with the necessary bounds.
  • Something which fulfills the abstract idea of a Substrate header. It has types for a Number, a Hash and a Hashing. It provides access to an extrinsics_root, state_root and parent_hash, as well as a digest and a block number.
  • The Metadata api trait that returns metadata for the runtime.
  • The offchain worker api.
  • Something that provides a runtime api.
  • Something that provides information about a runtime api.
  • Session keys runtime api.
  • A state backend is used to read state data and can have changes committed to it.
  • The TaggedTransactionQueue api trait for interfering with the transaction queue.

Functions

Type Definitions

Derive Macros

  • Derive parity_scale_codec::Decode and for struct and enum.
  • Derive parity_scale_codec::Encode and parity_scale_codec::EncodeLike for struct and enum.