referrerpolicy=no-referrer-when-downgrade

Module pallet_macros

Source
Expand description

Contains macro stubs for all of the pallet:: macros

Attribute Macros§

authorize
Allows to authorize some general transactions with specific dispatchable functions (dispatchable functions a.k.a. calls).
call
Allows a pallet to declare a set of functions as a dispatchable extrinsic.
call_index
Enforce the index of a variant in the generated enum Call.
compact
Declares the arguments of a call function to be encoded using [codec::Compact].
composite_enum
Allows defining an enum that gets composed as an aggregate enum by construct_runtime.
config
The mandatory attribute allowing definition of configurable types for the pallet.
constant
Allows adding an associated type trait bounded by Get from pallet::config into metadata.
disable_frame_system_supertrait_check
Allows bypassing the frame_system::Config supertrait check.
disable_try_decode_storage
Allows whitelisting a storage item from decoding during try-runtime checks.
error
Allows defining an error enum that will be returned from the dispatchable when an error occurs.
event
Allows defining pallet events.
extra_constants
Defines constants that are added to the constant field of PalletMetadata struct for this pallet.
feeless_if
Allows defining logic to make an extrinsic call feeless.
generate_deposit
Generates a helper function on Pallet that handles deposit events.
genesis_build
Allows you to define how the state of your pallet at genesis is built. This takes as input the GenesisConfig type (as self) and constructs the pallet’s initial state.
genesis_config
Allows you to define the genesis configuration for the pallet.
getter
Allows defining getter functions on Pallet storage.
hooks
The #[pallet::hooks] attribute allows you to specify a frame_support::traits::Hooks implementation for Pallet that specifies pallet-specific logic.
import_section
Splits a pallet declaration into multiple parts.
include_metadata
Selectively includes associated types in the metadata.
inherent
The #[pallet::inherent] attribute allows the pallet to provide inherents.
no_default
Ensures the trait item will not be used as a default with the #[derive_impl(..)] attribute macro.
no_default_bounds
Ensures the generated DefaultConfig will not have any bounds for that trait item.
origin
Allows a pallet to declare a type as an origin.
pallet_section
Declares a module as importable into a pallet via #[import_section].
storage
Declares a type alias as a storage item.
storage_prefix
Defines what storage prefix to use for a storage item when building the trie.
storage_version
Allows defining a storage version for the pallet.
task_condition
Allows defining conditions for a task to run.
task_index
Allows defining an index for a task.
task_list
Allows defining an iterator over available work items for a task.
task_weight
Allows defining the weight of a task.
tasks_experimental
Allows you to define some service work that can be recognized by a script or an off-chain worker.
type_value
Allows defining a struct implementing the Get trait to ease the use of storage types.
unbounded
Declares a storage as unbounded in potential size.
validate_unsigned
Allows the pallet to validate unsigned transactions.
view_functions
Allows defining view functions on a pallet.
weight
Allows specifying the weight of a call.
weight_of_authorize
Allows to define the weight of the authorize function.
whitelist_storage
Declare the storage as whitelisted from benchmarking.