Module polkadot_sdk_frame::runtime::prelude
source · Expand description
The main prelude of FRAME
for building runtimes.
A runtime typically starts with:
use polkadot_sdk_frame::runtime::prelude::*;
This automatically brings in polkadot_sdk_frame::prelude::*
.
Re-exports§
pub use crate::prelude::*;
Modules§
- Used for simple fee calculation. Re-exports
sp-weights
public API, and contains benchmarked weight constants specific to FRAME.
Macros§
- Macro to amalgamate the runtime into
struct Runtime
. - Types to define your runtime version. Create a const [
RuntimeString
]. - Macro to implement runtime APIs.
- Macros to easily impl traits such as
Get
for types. Macro for easily creating a new implementation of both theGet
andContains
traits. Use exactly as withparameter_types
, only the type must beOrd
. - Macros to easily impl traits such as
Get
for types. Create new implementations of theGet
trait.
Structs§
- The result of checking inherents.
- Const types that can easily be used in conjuncture with
Get
. Const getter for a basic type. - Const types that can easily be used in conjuncture with
Get
. Const getter for a basic type. - Const types that can easily be used in conjuncture with
Get
. Const getter for a basic type. - Const types that can easily be used in conjuncture with
Get
. Const getter for a basic type. - Const types that can easily be used in conjuncture with
Get
. Const getter for a basic type. - Const types that can easily be used in conjuncture with
Get
. Const getter for a basic type. - Const types that can easily be used in conjuncture with
Get
. Const getter for a basic type. - Const types that can easily be used in conjuncture with
Get
. Const getter for a basic type. - Const types that can easily be used in conjuncture with
Get
. Const getter for a basic type. - Const types that can easily be used in conjuncture with
Get
. Const getter for a basic type. - Const types that can easily be used in conjuncture with
Get
. Const getter for a basic type. - Primary types used to parameterize
EnsureOrigin
andEnsureRootWithArg
. Always fail. - Primary types used to parameterize
EnsureOrigin
andEnsureRootWithArg
. Ensure the origin isNone
. i.e. unsigned transaction. - Primary types used to parameterize
EnsureOrigin
andEnsureRootWithArg
. Ensure the origin is Root. - Primary types used to parameterize
EnsureOrigin
andEnsureRootWithArg
. Ensure the origin is Root and return the providedSuccess
value. - Primary types used to parameterize
EnsureOrigin
andEnsureRootWithArg
. Ensure the origin is anySigned
origin. - Primary types used to parameterize
EnsureOrigin
andEnsureRootWithArg
. Ensure the origin isSigned
origin from the givenAccountId
. - All of the types related to the FRAME runtime executive. Main entry point for certain runtime actions as e.g.
execute_block
. - Used for simple fee calculation. Implementor of
WeightToFee
such that it maps any unit of weight to a fixed fee. - Inherent data to include in a block.
- The version of the native runtime.
- Stores the encoded
RuntimeMetadata
for the native side as opaque type. - Types to define your runtime version. 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 possiblyauthoring_version
, absolutely notimpl_version
since they change the semantics of the runtime.
Enums§
- Set of test accounts.
- Confines the kind of extrinsics that can be included in a block.
Constants§
- The default
development
preset used to communicate with the runtime viaGenesisBuilder
interface. - The default
local_testnet
preset used to communicate with the runtime viaGenesisBuilder
interface.
Functions§
- For building genesis config. Build
GenesisConfig
from a JSON blob not using any defaults and store it in the storage. For more info refer tosp_genesis_builder::GenesisBuilder::build_state
. - For building genesis config. Get the default
GenesisConfig
as a JSON blob ifname
is None.
Type Aliases§
- The result of applying of an extrinsic.
- All of the types related to the FRAME runtime executive.
- All of the types related to the FRAME runtime executive.
- The result type alias, used in build methods.
Err
contains formatted error message. - Used for simple fee calculation. An implementation of
WeightToFee
that collects no fee. - All of the types related to the FRAME runtime executive.
- The type representing preset ID.
Attribute Macros§
- Macro to easily derive the
Config
trait of various pallet forRuntime
. This attribute can be used to derive a full implementation of a trait based on a local partial impl and an external impl containing defaults that can be overridden in the local impl. - Macro to amalgamate the runtime into
struct Runtime
. - Types to define your runtime version.