mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
Addressing Liam's comments from https://github.com/paritytech/polkadot-sdk/pull/2657 (#3150)
This commit is contained in:
@@ -86,7 +86,7 @@ pub(crate) fn expand_variant_count(
|
|||||||
// This is used for pallets without instance support or pallets with instance support when
|
// This is used for pallets without instance support or pallets with instance support when
|
||||||
// we don't specify instance:
|
// we don't specify instance:
|
||||||
//
|
//
|
||||||
// ```nocompile
|
// ```
|
||||||
// pub struct Pallet<T, I = ()>{..}
|
// pub struct Pallet<T, I = ()>{..}
|
||||||
//
|
//
|
||||||
// #[pallet::composite_enum]
|
// #[pallet::composite_enum]
|
||||||
|
|||||||
@@ -1513,7 +1513,7 @@ pub fn origin(_: TokenStream, _: TokenStream) -> TokenStream {
|
|||||||
///
|
///
|
||||||
/// ```ignore
|
/// ```ignore
|
||||||
/// Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, MaxEncodedLen, TypeInfo,
|
/// Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, MaxEncodedLen, TypeInfo,
|
||||||
/// RuntimeDebug,
|
/// RuntimeDebug
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// For ease of usage, when no `#[derive]` attributes are found for the enum under
|
/// For ease of usage, when no `#[derive]` attributes are found for the enum under
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
use crate::pallet::Def;
|
use crate::pallet::Def;
|
||||||
use proc_macro2::TokenStream;
|
use proc_macro2::TokenStream;
|
||||||
|
|
||||||
/// Expands `composite_enum` and adds the `VariantCount` implementation for it."
|
/// Expands `composite_enum` and adds the `VariantCount` implementation for it.
|
||||||
pub fn expand_composites(def: &mut Def) -> TokenStream {
|
pub fn expand_composites(def: &mut Def) -> TokenStream {
|
||||||
let mut expand = quote::quote!();
|
let mut expand = quote::quote!();
|
||||||
let frame_support = &def.frame_support;
|
let frame_support = &def.frame_support;
|
||||||
|
|||||||
@@ -91,14 +91,12 @@ pub struct CompositeDef {
|
|||||||
pub index: usize,
|
pub index: usize,
|
||||||
/// The composite keyword used (contains span).
|
/// The composite keyword used (contains span).
|
||||||
pub composite_keyword: keyword::CompositeKeyword,
|
pub composite_keyword: keyword::CompositeKeyword,
|
||||||
|
|
||||||
/// Name of the associated type.
|
/// Name of the associated type.
|
||||||
pub ident: syn::Ident,
|
pub ident: syn::Ident,
|
||||||
/// Type parameters and where clause attached to a declaration of the pallet::composite_enum.
|
/// Type parameters and where clause attached to a declaration of the pallet::composite_enum.
|
||||||
pub generics: syn::Generics,
|
pub generics: syn::Generics,
|
||||||
/// The span of the pallet::composite_enum attribute.
|
/// The span of the pallet::composite_enum attribute.
|
||||||
pub attr_span: proc_macro2::Span,
|
pub attr_span: proc_macro2::Span,
|
||||||
|
|
||||||
/// Variant count of the pallet::composite_enum.
|
/// Variant count of the pallet::composite_enum.
|
||||||
pub variant_count: u32,
|
pub variant_count: u32,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user