Skip to content

Commit

Permalink
fix nit
Browse files Browse the repository at this point in the history
  • Loading branch information
TarikGul committed Mar 13, 2024
1 parent 5f14309 commit c830265
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/api-derive/src/staking/stakerRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ function parseRewards (api: DeriveApi, stashId: AccountId, [erasPoints, erasPref
if ((exposure as PalletStakingExposure).own) {
staked = (exposure as PalletStakingExposure).own.unwrap();
} else {
const expAccount = exposure.others.find(({ who }) => who.toString() === validatorId);
const expAccount = exposure.others.find(({ who }) => who.eq(validatorId));

staked = expAccount ? expAccount.value.unwrap() : BN_ZERO;
staked = expAccount
? expAccount.value.unwrap()
: BN_ZERO;
}
} else {
const stakerExp = exposure.others.find(({ who }) => who.eq(stakerId));
Expand Down

0 comments on commit c830265

Please sign in to comment.