Module frame_support::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§
- Generic function to mark an execution path as ONLY defensive.
- Trigger a defensive failure if a condition is not met.
- Evaluate
$x:expr
and if not true returnErr($y:expr)
.
Structs§
- A bounded map based on a B-Tree.
- A bounded set based on a B-Tree.
- A bounded vector.
- Const getter for a basic type.
- Const getter for unsigned integers.
- Implement Get by returning Default for any type that implements Default.
- Inherent data to include in a block.
- Auxiliary to make any given error resolve to
is_fatal_error() == true
forIsFatalError
. - Zero-sized type used to mark things that “act like” they own a
T
. - Information concerning a valid transaction.
- A weakly bounded vector.
Enums§
- Reason why a dispatch call failed.
- An invalid transaction validity.
- The source of the transaction.
- Errors that can occur while checking the validity of a transaction.
- An unknown transaction validity.
Constants§
- The number of bytes of the module-specific
error
field defined inModuleError
. In FRAME, this is the maximum encoded size of a pallet error type.
Traits§
- Performs addition that returns
None
instead of wrapping around on overflow. - Convenience type to work around the highly unergonomic syntax needed to invoke the functions of overloaded generic traits, in this case
TryFrom
andTryInto
. - Performs division that returns
None
instead of panicking on division by zero and instead of wrapping around on underflow and overflow. - Performs multiplication that returns
None
instead of wrapping around on underflow or overflow. - Performs a left shift that returns
None
on shifts larger than or equal to the type width. - Performs a right shift that returns
None
on shifts larger than or equal to the type width. - Performs subtraction that returns
None
instead of wrapping around on underflow. - Trait that allows zero-copy read of value-references from slices in LE format.
- Trait that allows zero-copy write of value-references to slices in LE format.
- A trait for querying a single value from a type.
- Items implementing
MaxEncodedLen
have a statically known maximum encoded size. - A type that implements Serialize, DeserializeOwned and Debug when in std environment or serde feature is activated.
- A type that can be used in runtime structures.
- Defines a multiplicative identity element for
Self
. - Implementors return their meta type information.
- A trait for querying a single value from a type defined in the trait.
- Provide validation for unsigned extrinsics.
- Defines an additive identity element for
Self
.
Type Aliases§
- An identifier for an inherent.
- Minimum number of blocks a transaction will remain valid for.
TransactionLongevity::max_value()
means “forever”. - Priority for a transaction. Additive. Higher is better.
- Tag for a transaction. No two transactions with the same tag should be placed on-chain.
- Information on a transaction’s validity and, if valid, on how it relates to other transactions.
Attribute Macros§
- The optional attribute
#[inject_runtime_type]
can be attached toRuntimeCall
,RuntimeEvent
,RuntimeOrigin
orPalletInfo
in an impl statement that has#[register_default_impl]
attached to indicate that this item is generated byconstruct_runtime
. - Attach this attribute to an impl statement that you want to use with
#[derive_impl(..)]
.
Derive Macros§
- Derive
Clone
but do not bound any generic. - Derive
Debug
but do not bound any generic. - Derive
parity_scale_codec::Decode
and for struct and enum. - Derive
parity_scale_codec::Encode
andparity_scale_codec::EncodeLike
for struct and enum. - Derive
Eq
but do not bound any generic. - Derive
parity_scale_codec::MaxEncodedLen
for struct and enum. - Derive
PartialEq
but do not bound any generic. - Derive [
Debug
], ifstd
is enabled it usesframe_support::DebugNoBound
, ifstd
is not enabled it just returns"<wasm:stripped>"
. This behaviour is useful to prevent bloating the runtime WASM blob from unneeded code.