mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 07:58:00 +00:00
Migrate remaining old decl_* macros to the new pallet attribute macros (#12271)
* Migrate remaining old decl_* macros to the new pallet attribute macros Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Apply review suggestions Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Apply review suggestions Signed-off-by: koushiro <koushiro.cqx@gmail.com> * use pallet::storage * Fix dev rpc test Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Fix service tests Signed-off-by: koushiro <koushiro.cqx@gmail.com> Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
@@ -36,7 +36,7 @@ mod pallet_test {
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::generate_store(pub(super) trait Store)]
|
||||
pub struct Pallet<T>(_);
|
||||
pub struct Pallet<T>(PhantomData<T>);
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {
|
||||
@@ -46,21 +46,21 @@ mod pallet_test {
|
||||
}
|
||||
|
||||
#[pallet::storage]
|
||||
#[pallet::getter(fn heartbeat_after)]
|
||||
#[pallet::getter(fn value)]
|
||||
pub(crate) type Value<T: Config> = StorageValue<_, u32, OptionQuery>;
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::weight(0)]
|
||||
pub fn set_value(origin: OriginFor<T>, n: u32) -> DispatchResult {
|
||||
let _sender = frame_system::ensure_signed(origin)?;
|
||||
let _sender = ensure_signed(origin)?;
|
||||
Value::<T>::put(n);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::weight(0)]
|
||||
pub fn dummy(origin: OriginFor<T>, _n: u32) -> DispatchResult {
|
||||
let _sender = frame_system::ensure_none(origin)?;
|
||||
let _sender = ensure_none(origin)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user