-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove pallet::getter from pallet-staking #6184
Conversation
@@ -575,7 +575,7 @@ impl<T: Config> Pallet<T> { | |||
|
|||
let era_duration = (now_as_millis_u64.defensive_saturating_sub(active_era_start)) | |||
.saturated_into::<u64>(); | |||
let staked = Self::eras_total_stake(&active_era.index); | |||
let staked = Self::eras_total_stake(active_era.index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let staked = Self::eras_total_stake(active_era.index); | |
let staked = ErasTotalStake::<T>::get(&active_era.index); |
Part of the aim here is to replace any usage of Self::storage()
with Storage::<T>::get()
in the sdk codebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it's done. I replaced these usages everywhere I was able to spot them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One change but then looks good.
Co-authored-by: Guillaume Thiolliere <[email protected]>
Description
Part of #3326
Removes all pallet::getter occurrences from pallet-staking and replaces them with explicit implementations.
Adds tests to verify that retrieval of affected entities works as expected so via storage::getter.
Review Notes
derive
attribute are used in tests (either directly or indirectly).#[pallet::call]
and that requires#[pallet::call_index(0)]
annotation on each function in that block. So I thought it's better to separate them.