Attribute Macro frame_support::pallet_macros::constant
source · #[constant]
Expand description
Allows adding an associated type trait bounded by
Get
from pallet::config
into metadata.
§Example
#[frame_support::pallet]
mod pallet {
use frame_support::pallet_prelude::*;
#[pallet::config]
pub trait Config: frame_system::Config {
/// This is like a normal `Get` trait, but it will be added into metadata.
#[pallet::constant]
type Foo: Get<u32>;
}
}
§Note on deprecation of constants
- Usage of
deprecated
attribute will propagate deprecation information to the pallet metadata where the item was declared. - For general usage examples of
deprecated
attribute please refer to https://doc.rust-lang.org/nightly/reference/attributes/diagnostics.html#the-deprecated-attribute
Documentation for this macro can be found at frame_support::pallet_macros::constant
.