Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Ank4n committed Oct 8, 2024
1 parent 3d207d0 commit 0b4fd57
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
5 changes: 1 addition & 4 deletions substrate/frame/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1121,10 +1121,7 @@ impl<T: Config> EraInfo<T> {
}

/// Returns the next page that can be claimed or `None` if nothing to claim.
pub(crate) fn get_next_claimable_page(
era: EraIndex,
validator: &T::AccountId,
) -> Option<Page> {
pub(crate) fn get_next_claimable_page(era: EraIndex, validator: &T::AccountId) -> Option<Page> {
// Find next claimable page of paged exposure.
let page_count = Self::get_page_count(era, validator);
let all_claimable_pages: Vec<Page> = (0..page_count).collect();
Expand Down
4 changes: 2 additions & 2 deletions substrate/frame/staking/src/pallet/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ impl<T: Config> Pallet<T> {
validator_stash: T::AccountId,
era: EraIndex,
) -> DispatchResultWithPostInfo {
let page = EraInfo::<T>::get_next_claimable_page(era, &validator_stash)
.ok_or_else(|| {
let page =
EraInfo::<T>::get_next_claimable_page(era, &validator_stash).ok_or_else(|| {
Error::<T>::AlreadyClaimed
.with_weight(T::WeightInfo::payout_stakers_alive_staked(0))
})?;
Expand Down
8 changes: 4 additions & 4 deletions substrate/frame/staking/src/pallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ pub use impls::*;

use crate::{
asset, slashing, weights::WeightInfo, AccountIdLookupOf, ActiveEraInfo, BalanceOf,
DisablingStrategy, EraPayout, EraRewardPoints, ExposurePage, Forcing,
LedgerIntegrityState, MaxNominationsOf, NegativeImbalanceOf, Nominations, NominationsQuota,
PositiveImbalanceOf, RewardDestination, SessionInterface, StakingLedger, UnappliedSlash,
UnlockChunk, ValidatorPrefs,
DisablingStrategy, EraPayout, EraRewardPoints, ExposurePage, Forcing, LedgerIntegrityState,
MaxNominationsOf, NegativeImbalanceOf, Nominations, NominationsQuota, PositiveImbalanceOf,
RewardDestination, SessionInterface, StakingLedger, UnappliedSlash, UnlockChunk,
ValidatorPrefs,
};

// The speculative number of spans are used as an input of the weight annotation of
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7718,7 +7718,7 @@ mod ledger_recovery {
assert_eq!(asset::staked::<Test>(&333), lock_333_before); // OK
assert_eq!(Bonded::<Test>::get(&333), Some(444)); // OK
assert!(Payee::<Test>::get(&333).is_some()); // OK
// however, ledger associated with its controller was killed.
// however, ledger associated with its controller was killed.
assert!(Ledger::<Test>::get(&444).is_none()); // NOK

// side effects on 444 - ledger, bonded, payee, lock should be completely removed.
Expand Down

0 comments on commit 0b4fd57

Please sign in to comment.