mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 21:11:07 +00:00
Pallet macro support frame_system::Config with args (#8606)
This commit is contained in:
@@ -126,6 +126,10 @@ impl syn::parse::Parse for ConfigBoundParse {
|
||||
input.parse::<syn::Token![::]>()?;
|
||||
input.parse::<keyword::Config>()?;
|
||||
|
||||
if input.peek(syn::token::Lt) {
|
||||
input.parse::<syn::AngleBracketedGenericArguments>()?;
|
||||
}
|
||||
|
||||
Ok(Self(ident))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,6 +365,25 @@ pub mod pallet2 {
|
||||
}
|
||||
}
|
||||
|
||||
/// Test that the supertrait check works when we pass some parameter to the `frame_system::Config`.
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet3 {
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config<Origin = ()> {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {}
|
||||
}
|
||||
|
||||
frame_support::parameter_types!(
|
||||
pub const MyGetParam: u32= 10;
|
||||
pub const MyGetParam2: u32= 11;
|
||||
|
||||
Reference in New Issue
Block a user