referrerpolicy=no-referrer-when-downgrade

Module 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§

weights
Used for simple fee calculation. Re-exports sp-weights public API, and contains benchmarked weight constants specific to FRAME.

Macros§

construct_runtime
Macro to amalgamate the runtime into struct Runtime.
create_runtime_strDeprecated
Types to define your runtime version. Deprecated Cow::Borrowed() wrapper.
impl_runtime_apis
Macro to implement runtime APIs.
ord_parameter_types
Macros to easily impl traits such as Get for types. Macro for easily creating a new implementation of both the Get and Contains traits. Use exactly as with parameter_types, only the type must be Ord.
parameter_types
Macros to easily impl traits such as Get for types. Create new implementations of the Get trait.

Structs§

CheckInherentsResult
The result of checking inherents.
ConstBool
Const types that can easily be used in conjuncture with Get. Const getter for a basic type.
ConstI8
Const types that can easily be used in conjuncture with Get. Const getter for a basic type.
ConstI16
Const types that can easily be used in conjuncture with Get. Const getter for a basic type.
ConstI32
Const types that can easily be used in conjuncture with Get. Const getter for a basic type.
ConstI64
Const types that can easily be used in conjuncture with Get. Const getter for a basic type.
ConstI128
Const types that can easily be used in conjuncture with Get. Const getter for a basic type.
ConstU8
Const types that can easily be used in conjuncture with Get. Const getter for a basic type.
ConstU16
Const types that can easily be used in conjuncture with Get. Const getter for a basic type.
ConstU32
Const types that can easily be used in conjuncture with Get. Const getter for a basic type.
ConstU64
Const types that can easily be used in conjuncture with Get. Const getter for a basic type.
ConstU128
Const types that can easily be used in conjuncture with Get. Const getter for a basic type.
EnsureNever
Primary types used to parameterize EnsureOrigin and EnsureRootWithArg. Always fail.
EnsureNone
Primary types used to parameterize EnsureOrigin and EnsureRootWithArg. Ensure the origin is None. i.e. unsigned transaction.
EnsureRoot
Primary types used to parameterize EnsureOrigin and EnsureRootWithArg. Ensure the origin is Root.
EnsureRootWithSuccess
Primary types used to parameterize EnsureOrigin and EnsureRootWithArg. Ensure the origin is Root and return the provided Success value.
EnsureSigned
Primary types used to parameterize EnsureOrigin and EnsureRootWithArg. Ensure the origin is any Signed origin.
EnsureSignedBy
Primary types used to parameterize EnsureOrigin and EnsureRootWithArg. Ensure the origin is Signed origin from the given AccountId.
Executive
All of the types related to the FRAME runtime executive. Main entry point for certain runtime actions as e.g. execute_block.
FixedFee
Used for simple fee calculation. Implementor of WeightToFee such that it maps any unit of weight to a fixed fee.
InherentData
Inherent data to include in a block.
NativeVersion
The version of the native runtime.
OpaqueMetadata
Stores the encoded RuntimeMetadata for the native side as opaque type.
RuntimeVersion
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.

Enums§

ExecutiveError
All of the types related to the FRAME runtime executive.
ExtrinsicInclusionMode
Confines the kind of extrinsics that can be included in a block.
Sr25519Keyring
Set of test accounts.

Constants§

DEV_RUNTIME_PRESET
The default development preset used to communicate with the runtime via GenesisBuilder interface.
LOCAL_TESTNET_RUNTIME_PRESET
The default local_testnet preset used to communicate with the runtime via GenesisBuilder interface.

Functions§

build_state
For building genesis config. Build GenesisConfig from a JSON blob not using any defaults and store it in the storage. For more info refer to sp_genesis_builder::GenesisBuilder::build_state.
get_preset
For building genesis config. Get the default GenesisConfig as a JSON blob if name is None.

Type Aliases§

ApplyExtrinsicResult
The result of applying of an extrinsic.
CallOf
All of the types related to the FRAME runtime executive.
CheckedOf
All of the types related to the FRAME runtime executive.
GenesisBuilderResult
The result type alias, used in build methods. Err contains formatted error message.
NoFee
Used for simple fee calculation. An implementation of WeightToFee that collects no fee.
OriginOf
All of the types related to the FRAME runtime executive.
PresetId
The type representing preset ID.

Attribute Macros§

derive_impl
Macro to easily derive the Config trait of various pallet for Runtime. 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.
frame_construct_runtime
Macro to amalgamate the runtime into struct Runtime.
runtime_version