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-weightspublic API, and contains benchmarked weight constants specific to FRAME.
Macros§
- construct_
runtime - Macro to amalgamate the runtime into
struct Runtime. - create_
runtime_ str Deprecated - 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
Getfor types. Macro for easily creating a new implementation of both theGetandContainstraits. Use exactly as withparameter_types, only the type must beOrd. - parameter_
types - Macros to easily impl traits such as
Getfor types. Create new implementations of theGettrait.
Structs§
- Check
Inherents Result - The result of checking inherents.
- Const
Bool - 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. - Const
I16 - Const types that can easily be used in conjuncture with
Get. Const getter for a basic type. - Const
I32 - Const types that can easily be used in conjuncture with
Get. Const getter for a basic type. - Const
I64 - Const types that can easily be used in conjuncture with
Get. Const getter for a basic type. - Const
I128 - 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. - Const
U16 - Const types that can easily be used in conjuncture with
Get. Const getter for a basic type. - Const
U32 - Const types that can easily be used in conjuncture with
Get. Const getter for a basic type. - Const
U64 - Const types that can easily be used in conjuncture with
Get. Const getter for a basic type. - Const
U128 - Const types that can easily be used in conjuncture with
Get. Const getter for a basic type. - Ensure
Never - Primary types used to parameterize
EnsureOriginandEnsureRootWithArg. Always fail. - Ensure
None - Primary types used to parameterize
EnsureOriginandEnsureRootWithArg. Ensure the origin isNone. i.e. unsigned transaction. - Ensure
Root - Primary types used to parameterize
EnsureOriginandEnsureRootWithArg. Ensure the origin is Root. - Ensure
Root With Success - Primary types used to parameterize
EnsureOriginandEnsureRootWithArg. Ensure the origin is Root and return the providedSuccessvalue. - Ensure
Signed - Primary types used to parameterize
EnsureOriginandEnsureRootWithArg. Ensure the origin is anySignedorigin. - Ensure
Signed By - Primary types used to parameterize
EnsureOriginandEnsureRootWithArg. Ensure the origin isSignedorigin from the givenAccountId. - Executive
- All of the types related to the FRAME runtime executive.
Main entry point for certain runtime actions as e.g.
execute_block. - Fixed
Fee - Used for simple fee calculation.
Implementor of
WeightToFeesuch that it maps any unit of weight to a fixed fee. - Inherent
Data - Inherent data to include in a block.
- Native
Version - The version of the native runtime.
- Opaque
Metadata - Stores the encoded
RuntimeMetadatafor the native side as opaque type. - 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_versionand possiblyauthoring_version, absolutely notimpl_versionsince they change the semantics of the runtime.
Enums§
- Executive
Error - All of the types related to the FRAME runtime executive.
- Extrinsic
Inclusion Mode - Confines the kind of extrinsics that can be included in a block.
- Sr25519
Keyring - Set of test accounts.
Constants§
- DEV_
RUNTIME_ PRESET - The default
developmentpreset used to communicate with the runtime viaGenesisBuilderinterface. - LOCAL_
TESTNET_ RUNTIME_ PRESET - The default
local_testnetpreset used to communicate with the runtime viaGenesisBuilderinterface.
Functions§
- build_
state - For building genesis config.
Build
GenesisConfigfrom a JSON blob not using any defaults and store it in the storage. For more info refer tosp_genesis_builder::GenesisBuilder::build_state. - get_
preset - For building genesis config.
Get the default
GenesisConfigas a JSON blob ifnameis None.
Type Aliases§
- Apply
Extrinsic Result - The result of applying of an extrinsic.
- CallOf
- All of the types related to the FRAME runtime executive.
- Checked
Of - All of the types related to the FRAME runtime executive.
- Genesis
Builder Result - The result type alias, used in build methods.
Errcontains formatted error message. - NoFee
- Used for simple fee calculation.
An implementation of
WeightToFeethat collects no fee. - Origin
Of - All of the types related to the FRAME runtime executive.
- Preset
Id - The type representing preset ID.
Attribute Macros§
- derive_
impl - Macro to easily derive the
Configtrait 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. - frame_
construct_ runtime - Macro to amalgamate the runtime into
struct Runtime. - runtime_
version