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_ 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
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
. - parameter_
types - Macros to easily impl traits such as
Get
for types. Create new implementations of theGet
trait.
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
EnsureOrigin
andEnsureRootWithArg
. Always fail. - Ensure
None - Primary types used to parameterize
EnsureOrigin
andEnsureRootWithArg
. Ensure the origin isNone
. i.e. unsigned transaction. - Ensure
Root - Primary types used to parameterize
EnsureOrigin
andEnsureRootWithArg
. Ensure the origin is Root. - Ensure
Root With Success - Primary types used to parameterize
EnsureOrigin
andEnsureRootWithArg
. Ensure the origin is Root and return the providedSuccess
value. - Ensure
Signed - Primary types used to parameterize
EnsureOrigin
andEnsureRootWithArg
. Ensure the origin is anySigned
origin. - Ensure
Signed By - Primary types used to parameterize
EnsureOrigin
andEnsureRootWithArg
. Ensure the origin isSigned
origin 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
WeightToFee
such 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
RuntimeMetadata
for 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_version
and possiblyauthoring_version
, absolutely notimpl_version
since 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
development
preset used to communicate with the runtime viaGenesisBuilder
interface. - LOCAL_
TESTNET_ RUNTIME_ PRESET - The default
local_testnet
preset used to communicate with the runtime viaGenesisBuilder
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 tosp_genesis_builder::GenesisBuilder::build_state
. - get_
preset - For building genesis config.
Get the default
GenesisConfig
as a JSON blob ifname
is 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.
Err
contains formatted error message. - NoFee
- Used for simple fee calculation.
An implementation of
WeightToFee
that 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
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. - frame_
construct_ runtime - Macro to amalgamate the runtime into
struct Runtime
. - runtime_
version