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 crate::transaction::*;pub use super::account::*;pub use super::arithmetic::*;pub use super::token::*;
Modules§
- frame_
system frame_system’s parent crate, which is mandatory in all pallets build with this crate.
Macros§
- defensive
- Generic function to mark an execution path as ONLY defensive.
- defensive_
assert - Trigger a defensive failure if a condition is not met.
Structs§
- Bounded
Slice - Bounded storage related types. A bounded slice.
- Bounded
Vec - Bounded storage related types. A bounded vector.
- Either
Of - “OR gate” implementation of
EnsureOrigin,Successtype for bothLandRmust be equal. - Inside
Both - A
Containsimplementation which contains all members ofThesewhich are also members ofThose. - MapSuccess
- A derivative
EnsureOriginimplementation. It mutates theSuccessresult of anOriginalimplementation with a givenMutator. - NoOp
Poll - NoOp polling is required if pallet-referenda functionality not needed.
- Pallet
Id - A pallet identifier. These are per pallet and should be stored in a registry somewhere.
- Variant
Count Of - Adapter for
Get<u32>to accessVARIANT_COUNTfromtrait pub trait VariantCount {.
Enums§
- Everything
- A
Containsimplementation that contains every value.
Traits§
- Contains
- A trait for querying whether a type can be said to “contain” a value.
- Defensive
- A trait to handle errors and options when you are really sure that a condition must hold, but
not brave enough to
expecton it, or a default fallback value makes more sense. - Defensive
Saturating - A variant of
Defensivewith the same rationale, for the arithmetic operations where in case an infallible operation fails, it saturates. - Estimate
Next Session Rotation - Something that can estimate at which block the next session rotation will happen (i.e. a new session starts).
- Instance
Filter - Simple trait for providing a filter over a reference to some type, given an instance of itself.
- IsSub
Type - Something that can be checked to be a of sub type
T. - OnRuntime
Upgrade - See
Hooks::on_runtime_upgrade. - OneSession
Handler - A session handler for specific key type.
- Pallet
Info Access - Provides information about the pallet itself and its setup in the runtime.
- Ranked
Members - Ranked membership data structure.
- Ranked
Members Swap Handler - Handler that can deal with the swap of two members.
- Variant
Count - Trait to get the number of variants in any enum.