Module pallet_prelude

Module pallet_prelude 

Source
Expand description

Prelude to be used alongside pallet macro, for ease of use.

Re-exports§

pub use crate::dispatch::DispatchClass;
pub use crate::dispatch::DispatchResult;
pub use crate::dispatch::DispatchResultWithPostInfo;
pub use crate::dispatch::Parameter;
pub use crate::dispatch::Pays;
pub use crate::inherent::ProvideInherent;
pub use crate::storage;
pub use crate::storage::types::CountedStorageMap;
pub use crate::storage::types::CountedStorageNMap;
pub use crate::storage::types::Key as NMapKey;
pub use crate::storage::types::OptionQuery;
pub use crate::storage::types::ResultQuery;
pub use crate::storage::types::StorageDoubleMap;
pub use crate::storage::types::StorageMap;
pub use crate::storage::types::StorageNMap;
pub use crate::storage::types::StorageValue;
pub use crate::storage::types::ValueQuery;
pub use crate::storage::StorageList;
pub use crate::traits::BuildGenesisConfig;
pub use crate::traits::EnsureOrigin;
pub use crate::traits::GetStorageVersion;
pub use crate::traits::Hooks;
pub use crate::traits::IsType;
pub use crate::traits::PalletInfoAccess;
pub use crate::traits::StorageInfoTrait;
pub use crate::traits::StorageVersion;
pub use crate::traits::Task;
pub use crate::Blake2_128;
pub use crate::Blake2_128Concat;
pub use crate::Blake2_256;
pub use crate::Identity;
pub use crate::Twox128;
pub use crate::Twox256;
pub use crate::Twox64Concat;
pub use frame_support::pallet_macros::*;

Macros§

defensive
Generic function to mark an execution path as ONLY defensive.
defensive_assert
Trigger a defensive failure if a condition is not met.
ensure
Evaluate $x:expr and if not true return Err($y:expr).

Structs§

BoundedBTreeMap
A bounded map based on a B-Tree.
BoundedBTreeSet
A bounded set based on a B-Tree.
BoundedVec
A bounded vector.
ConstU32
Const getter for a basic type.
GetDefault
Implement Get by returning Default for any type that implements Default.
InherentData
Inherent data to include in a block.
MakeFatalError
Auxiliary to make any given error resolve to is_fatal_error() == true for IsFatalError.
PhantomData
Zero-sized type used to mark things that “act like” they own a T.
ValidTransaction
Information concerning a valid transaction.
WeakBoundedVec
A weakly bounded vector.
Weight

Enums§

DispatchError
Reason why a dispatch call failed.
InvalidTransaction
An invalid transaction validity.
TransactionSource
The source of the transaction.
TransactionValidityError
Errors that can occur while checking the validity of a transaction.
UnknownTransaction
An unknown transaction validity.

Constants§

MAX_MODULE_ERROR_ENCODED_SIZE
The number of bytes of the module-specific error field defined in ModuleError. In FRAME, this is the maximum encoded size of a pallet error type.

Traits§

Decode
Trait that allows zero-copy read of value-references from slices in LE format.
Encode
Trait that allows zero-copy write of value-references to slices in LE format.
Get
A trait for querying a single value from a type.
MaxEncodedLen
Items implementing MaxEncodedLen have a statically known maximum encoded size.
MaybeSerializeDeserialize
A type that implements Serialize, DeserializeOwned and Debug when in std environment or serde feature is activated.
Member
A type that can be used in runtime structures.
TypeInfo
Implementors return their meta type information.
TypedGet
A trait for querying a single value from a type defined in the trait.
ValidateUnsigned
Provide validation for unsigned extrinsics.

Type Aliases§

InherentIdentifier
An identifier for an inherent.
TransactionLongevity
Minimum number of blocks a transaction will remain valid for. TransactionLongevity::max_value() means “forever”.
TransactionPriority
Priority for a transaction. Additive. Higher is better.
TransactionTag
Tag for a transaction. No two transactions with the same tag should be placed on-chain.
TransactionValidity
Information on a transaction’s validity and, if valid, on how it relates to other transactions.

Attribute Macros§

inject_runtime_type
The optional attribute #[inject_runtime_type] can be attached to RuntimeCall, RuntimeEvent, RuntimeOrigin or PalletInfo in an impl statement that has #[register_default_impl] attached to indicate that this item is generated by construct_runtime.
register_default_impl
Attach this attribute to an impl statement that you want to use with #[derive_impl(..)].

Derive Macros§

CloneNoBound
Derive Clone but do not bound any generic.
DebugNoBound
Derive Debug but do not bound any generic.
Decode
Derive parity_scale_codec::Decode and for struct and enum.
Encode
Derive parity_scale_codec::Encode and parity_scale_codec::EncodeLike for struct and enum.
EqNoBound
Derive Eq but do not bound any generic.
MaxEncodedLen
Derive parity_scale_codec::MaxEncodedLen for struct and enum.
PartialEqNoBound
Derive PartialEq but do not bound any generic.
RuntimeDebug
RuntimeDebugNoBound
Derive [Debug], if std is enabled it uses frame_support::DebugNoBound, if std is not enabled it just returns "<wasm:stripped>". This behaviour is useful to prevent bloating the runtime WASM blob from unneeded code.
TypeInfo