referrerpolicy=no-referrer-when-downgrade

Module prelude

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

BoundedSlice
Bounded storage related types. A bounded slice.
BoundedVec
Bounded storage related types. A bounded vector.
EitherOf
“OR gate” implementation of EnsureOrigin, Success type for both L and R must be equal.
InsideBoth
A Contains implementation which contains all members of These which are also members of Those.
MapSuccess
A derivative EnsureOrigin implementation. It mutates the Success result of an Original implementation with a given Mutator.
NoOpPoll
NoOp polling is required if pallet-referenda functionality not needed.
PalletId
A pallet identifier. These are per pallet and should be stored in a registry somewhere.
VariantCountOf
Adapter for Get<u32> to access VARIANT_COUNT from trait pub trait VariantCount {.

Enums§

Everything
A Contains implementation 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 expect on it, or a default fallback value makes more sense.
DefensiveSaturating
A variant of Defensive with the same rationale, for the arithmetic operations where in case an infallible operation fails, it saturates.
EstimateNextSessionRotation
Something that can estimate at which block the next session rotation will happen (i.e. a new session starts).
InstanceFilter
Simple trait for providing a filter over a reference to some type, given an instance of itself.
IsSubType
Something that can be checked to be a of sub type T.
OnRuntimeUpgrade
See Hooks::on_runtime_upgrade.
OneSessionHandler
A session handler for specific key type.
PalletInfoAccess
Provides information about the pallet itself and its setup in the runtime.
RankedMembers
Ranked membership data structure.
RankedMembersSwapHandler
Handler that can deal with the swap of two members.
VariantCount
Trait to get the number of variants in any enum.