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
frompallet::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 (asself
) 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 aframe_support::traits::Hooks
implementation forPallet
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.