Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed Dec 8, 2023
1 parent 9e66e03 commit 2f084cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions pallets/dapp-staking-v3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1137,9 +1137,8 @@ pub mod pallet {
let earliest_staked_era = ledger
.earliest_staked_era()
.ok_or(Error::<T>::InternalClaimStakerError)?;
let era_rewards =
EraRewards::<T>::get(Self::era_reward_index(earliest_staked_era))
.ok_or(Error::<T>::NoClaimableRewards)?;
let era_rewards = EraRewards::<T>::get(Self::era_reward_index(earliest_staked_era))
.ok_or(Error::<T>::NoClaimableRewards)?;

// The last era for which we can theoretically claim rewards.
// And indicator if we know the period's ending era.
Expand Down
3 changes: 2 additions & 1 deletion pallets/dapp-staking-v3/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@ where
}
// In case it doesn't (i.e. first time staking), then the future era must either be the current or the next era.
} else if let Some(stake_amount) = self.staked_future {
if stake_amount.era != current_era.saturating_add(1) && stake_amount.era != current_era {
if stake_amount.era != current_era.saturating_add(1) && stake_amount.era != current_era
{
return Err(AccountLedgerError::InvalidEra);
}
if stake_amount.period != current_period_info.number {
Expand Down

0 comments on commit 2f084cf

Please sign in to comment.