Expand description
The main prelude of FRAME.
This prelude should almost always be the first line of code in any pallet or runtime.
use polkadot_sdk_frame::prelude::*;
// rest of your pallet..
mod pallet {}
Re-exports§
pub use frame_support::dispatch::GetDispatchInfo;
pub use frame_support::dispatch::PostDispatchInfo;
pub use sp_runtime::traits::AccountIdConversion;
pub use sp_runtime::traits::BlockNumberProvider;
pub use sp_runtime::traits::Bounded;
pub use sp_runtime::traits::Convert;
pub use sp_runtime::traits::ConvertBack;
pub use sp_runtime::traits::DispatchInfoOf;
pub use sp_runtime::traits::Dispatchable;
pub use sp_runtime::traits::ReduceBy;
pub use sp_runtime::traits::ReplaceWithDefault;
pub use sp_runtime::traits::SaturatedConversion;
pub use sp_runtime::traits::Saturating;
pub use sp_runtime::traits::StaticLookup;
pub use sp_runtime::traits::TrailingZeroInput;
pub use sp_runtime::BoundToRuntimeAppPublic;
pub use sp_runtime::DispatchErrorWithPostInfo;
pub use sp_runtime::DispatchResultWithInfo;
pub use sp_runtime::TokenError;
pub use frame_support::pallet_prelude::*;
pub use frame_system::pallet_prelude::*;
pub use frame_system::offchain::*;
pub use super::derive::*;
pub use super::hashing::*;
pub use super::account::*;
pub use super::arithmetic::*;
pub use super::token::*;
Modules§
frame_system
’s parent crate, which is mandatory in all pallets build with this crate.
Structs§
- Bounded storage related types. A bounded slice.
- Bounded storage related types. A bounded vector.
- “OR gate” implementation of
EnsureOrigin
,Success
type for bothL
andR
must be equal. - A derivative
EnsureOrigin
implementation. It mutates theSuccess
result of anOriginal
implementation with a givenMutator
. - NoOp polling is required if pallet-referenda functionality not needed.
- A pallet identifier. These are per pallet and should be stored in a registry somewhere.
- Adapter for
Get<u32>
to accessVARIANT_COUNT
fromtrait pub trait VariantCount {
.
Enums§
- A
Contains
implementation that contains every value.
Traits§
- A trait for querying whether a type can be said to “contain” a value.
- A trait to handle errors and options when you are really sure that a condition must hold, but not brave enough to
expect
on it, or a default fallback value makes more sense. - A variant of
Defensive
with the same rationale, for the arithmetic operations where in case an infallible operation fails, it saturates. - Something that can estimate at which block the next session rotation will happen (i.e. a new session starts).
- Something that can be checked to be a of sub type
T
. - A session handler for specific key type.
- Ranked membership data structure.
- Handler that can deal with the swap of two members.
- Trait to get the number of variants in any enum.