Add HoldReason to the NIS pallet (#13823)

* Add HoldReason to the NIS pallet

* Rename composable_enum to composite_enum

* Add encoding test

* Add more doc comments
This commit is contained in:
Keith Yeung
2023-04-06 14:24:45 +08:00
committed by GitHub
parent 3ace2f50c5
commit 38f3b053d7
8 changed files with 27 additions and 9 deletions
+6 -6
View File
@@ -1552,7 +1552,7 @@ pub mod pallet_prelude {
/// * [`pallet::inherent`](#inherent-palletinherent-optional)
/// * [`pallet::validate_unsigned`](#validate-unsigned-palletvalidate_unsigned-optional)
/// * [`pallet::origin`](#origin-palletorigin-optional)
/// * [`pallet::composable_enum`](#composable-enum-palletcomposable_enum-optional)
/// * [`pallet::composite_enum`](#composite-enum-palletcomposite_enum-optional)
///
/// Note that at compile-time, the `#[pallet]` macro will analyze and expand all of these
/// attributes, ultimately removing their AST nodes before they can be parsed as real
@@ -2278,19 +2278,19 @@ pub mod pallet_prelude {
///
/// Also see [`pallet::origin`](`frame_support::pallet_macros::origin`)
///
/// # Composable enum `#[pallet::composable_enum]` (optional)
/// # Composite enum `#[pallet::composite_enum]` (optional)
///
/// The `#[pallet::composable_enum]` attribute allows you to define an enum on the pallet which
/// The `#[pallet::composite_enum]` attribute allows you to define an enum on the pallet which
/// will then instruct `construct_runtime` to amalgamate all similarly-named enums from other
/// pallets into an aggregate enum. This is similar in principle with how the aggregate enum is
/// generated for `#[pallet::event]` or `#[pallet::error]`.
///
/// The item tagged with `#[pallet::composable_enum]` MUST be an enum declaration, and can ONLY
/// The item tagged with `#[pallet::composite_enum]` MUST be an enum declaration, and can ONLY
/// be the following identifiers: `FreezeReason`, `HoldReason`, `LockId` or `SlashReason`.
/// Custom identifiers are not supported.
///
/// NOTE: For ease of usage, when no `#[derive]` attributes are detected, the
/// `#[pallet::composable_enum]` attribute will automatically derive the following traits for
/// `#[pallet::composite_enum]` attribute will automatically derive the following traits for
/// the enum:
///
/// ```ignore
@@ -2832,7 +2832,7 @@ pub use frame_support_procedural::pallet;
/// Contains macro stubs for all of the pallet:: macros
pub mod pallet_macros {
pub use frame_support_procedural::{
call_index, compact, composable_enum, config, constant,
call_index, compact, composite_enum, config, constant,
disable_frame_system_supertrait_check, error, event, extra_constants, generate_deposit,
generate_storage_info, generate_store, genesis_build, genesis_config, getter, hooks,
inherent, origin, storage, storage_prefix, storage_version, type_value, unbounded,