mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 13:57:58 +00:00
Allow additional trait bounds for #[pallet::constant] (#9050)
* Allow additional trait bounds for constants * Add ui test for constants with additional trait bounds * Update trait constant ui test * Import syn::Error * Use reference instead of cloning * Add extra invalid bound ui test * Out or order valid bounds * Fix ui test * Fix ui test * Apply review suggestion about error message
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#[frame_support::pallet]
|
||||
mod pallet {
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::BlockNumberFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {
|
||||
#[pallet::constant]
|
||||
type U: Get<u32>;
|
||||
|
||||
#[pallet::constant]
|
||||
type V: Get<u32> + From<u16>;
|
||||
|
||||
#[pallet::constant]
|
||||
type W: From<u16> + Get<u32>;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
Reference in New Issue
Block a user