Skip to content

Commit 313fe0f

Browse files
Remove usage of the pallet::getter macro from pallet-fast-unstake (#4514)
As per #3326, removes pallet::getter macro usage from pallet-fast-unstake. The syntax `StorageItem::<T, I>::get()` should be used instead. cc @muraca --------- Co-authored-by: Liam Aharon <[email protected]>
1 parent e7b6d7d commit 313fe0f

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

prdoc/pr_4514.prdoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
2+
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json
3+
4+
title: Removed `pallet::getter` usage from pallet-fast-unstake
5+
6+
doc:
7+
- audience: Runtime Dev
8+
description: |
9+
This PR removed the `pallet::getter`s from `pallet-fast-unstake`.
10+
The syntax `StorageItem::<T, I>::get()` should be used instead.
11+
12+
crates:
13+
- name: pallet-fast-unstake
14+
bump: major

substrate/frame/fast-unstake/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ macro_rules! log {
141141
($level:tt, $patter:expr $(, $values:expr)* $(,)?) => {
142142
log::$level!(
143143
target: crate::LOG_TARGET,
144-
concat!("[{:?}] 💨 ", $patter), <frame_system::Pallet<T>>::block_number() $(, $values)*
144+
concat!("[{:?}] 💨 ", $patter), frame_system::Pallet::<T>::block_number() $(, $values)*
145145
)
146146
};
147147
}
@@ -227,7 +227,6 @@ pub mod pallet {
227227
/// checked. The checking is represented by updating [`UnstakeRequest::checked`], which is
228228
/// stored in [`Head`].
229229
#[pallet::storage]
230-
#[pallet::getter(fn eras_to_check_per_block)]
231230
pub type ErasToCheckPerBlock<T: Config> = StorageValue<_, u32, ValueQuery>;
232231

233232
#[pallet::event]
@@ -332,7 +331,7 @@ pub mod pallet {
332331
pub fn register_fast_unstake(origin: OriginFor<T>) -> DispatchResult {
333332
let ctrl = ensure_signed(origin)?;
334333

335-
ensure!(ErasToCheckPerBlock::<T>::get() != 0, <Error<T>>::CallNotAllowed);
334+
ensure!(ErasToCheckPerBlock::<T>::get() != 0, Error::<T>::CallNotAllowed);
336335
let stash_account =
337336
T::Staking::stash_by_ctrl(&ctrl).map_err(|_| Error::<T>::NotController)?;
338337
ensure!(!Queue::<T>::contains_key(&stash_account), Error::<T>::AlreadyQueued);
@@ -373,7 +372,7 @@ pub mod pallet {
373372
pub fn deregister(origin: OriginFor<T>) -> DispatchResult {
374373
let ctrl = ensure_signed(origin)?;
375374

376-
ensure!(ErasToCheckPerBlock::<T>::get() != 0, <Error<T>>::CallNotAllowed);
375+
ensure!(ErasToCheckPerBlock::<T>::get() != 0, Error::<T>::CallNotAllowed);
377376

378377
let stash_account =
379378
T::Staking::stash_by_ctrl(&ctrl).map_err(|_| Error::<T>::NotController)?;

0 commit comments

Comments
 (0)