This repository was archived by the owner on Nov 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
procedural/src/pallet/expand Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ pub fn expand_hooks(def: &mut Def) -> proc_macro2::TokenStream {
7676 quote:: quote! {
7777 impl <#type_impl_gen>
7878 #frame_support:: traits:: Hooks <<T as #frame_system:: Config >:: BlockNumber >
79- for Pallet <#type_use_gen> { }
79+ for #pallet_ident <#type_use_gen> #where_clause { }
8080 }
8181 } else {
8282 proc_macro2:: TokenStream :: new ( )
Original file line number Diff line number Diff line change @@ -22,5 +22,4 @@ mod pallet {
2222 type Foo < T > = StorageValue < _ , u8 > ;
2323}
2424
25- fn main ( ) {
26- }
25+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ #[ frame_support:: pallet]
2+ mod pallet {
3+ #[ pallet:: config]
4+ pub trait Config : frame_system:: Config where <Self as frame_system:: Config >:: Index : From < u128 > { }
5+
6+ #[ pallet:: pallet]
7+ pub struct Pallet < T > ( core:: marker:: PhantomData < T > ) ;
8+
9+ #[ pallet:: call]
10+ impl < T : Config > Pallet < T > where <T as frame_system:: Config >:: Index : From < u128 > { }
11+
12+ impl < T : Config > Pallet < T > where <T as frame_system:: Config >:: Index : From < u128 > {
13+ fn foo ( x : u128 ) {
14+ let _index = <T as frame_system:: Config >:: Index :: from ( x) ;
15+ }
16+ }
17+ }
18+
19+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments