Skip to content
Snippets Groups Projects
Unverified Commit 313fe0f9 authored by polka.dom's avatar polka.dom Committed by GitHub
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: default avatarLiam Aharon <liam.aharon@hotmail.com>
parent e7b6d7df
No related merge requests found
Pipeline #476237 waiting for manual action with stages
in 1 hour, 12 minutes, and 10 seconds
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json
title: Removed `pallet::getter` usage from pallet-fast-unstake
doc:
- audience: Runtime Dev
description: |
This PR removed the `pallet::getter`s from `pallet-fast-unstake`.
The syntax `StorageItem::<T, I>::get()` should be used instead.
crates:
- name: pallet-fast-unstake
bump: major
......@@ -141,7 +141,7 @@ macro_rules! log {
($level:tt, $patter:expr $(, $values:expr)* $(,)?) => {
log::$level!(
target: crate::LOG_TARGET,
concat!("[{:?}] 💨 ", $patter), <frame_system::Pallet<T>>::block_number() $(, $values)*
concat!("[{:?}] 💨 ", $patter), frame_system::Pallet::<T>::block_number() $(, $values)*
)
};
}
......@@ -227,7 +227,6 @@ pub mod pallet {
/// checked. The checking is represented by updating [`UnstakeRequest::checked`], which is
/// stored in [`Head`].
#[pallet::storage]
#[pallet::getter(fn eras_to_check_per_block)]
pub type ErasToCheckPerBlock<T: Config> = StorageValue<_, u32, ValueQuery>;
#[pallet::event]
......@@ -332,7 +331,7 @@ pub mod pallet {
pub fn register_fast_unstake(origin: OriginFor<T>) -> DispatchResult {
let ctrl = ensure_signed(origin)?;
ensure!(ErasToCheckPerBlock::<T>::get() != 0, <Error<T>>::CallNotAllowed);
ensure!(ErasToCheckPerBlock::<T>::get() != 0, Error::<T>::CallNotAllowed);
let stash_account =
T::Staking::stash_by_ctrl(&ctrl).map_err(|_| Error::<T>::NotController)?;
ensure!(!Queue::<T>::contains_key(&stash_account), Error::<T>::AlreadyQueued);
......@@ -373,7 +372,7 @@ pub mod pallet {
pub fn deregister(origin: OriginFor<T>) -> DispatchResult {
let ctrl = ensure_signed(origin)?;
ensure!(ErasToCheckPerBlock::<T>::get() != 0, <Error<T>>::CallNotAllowed);
ensure!(ErasToCheckPerBlock::<T>::get() != 0, Error::<T>::CallNotAllowed);
let stash_account =
T::Staking::stash_by_ctrl(&ctrl).map_err(|_| Error::<T>::NotController)?;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment