Display last target payout (#4101)

* Ensure identity filter applies to all targets

* Name filter removes flags

* Revert

* Apply query filters to override toggles

* Display last target payout
This commit is contained in:
Jaco Greeff 2020-11-29 18:34:19 +01:00 committed by GitHub
parent 5f7fc6c6d8
commit 066e5eca04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 1 deletions

View File

@ -63,7 +63,7 @@ function Validator ({ allSlashes, canSelect, filterName, info, isNominated, isSe
return null;
}
const { accountId, bondOther, bondOwn, bondTotal, commissionPer, isCommission, isElected, isFavorite, key, numNominators, rankOverall, stakedReturnCmp, validatorPayment } = info;
const { accountId, bondOther, bondOwn, bondTotal, commissionPer, isCommission, isElected, isFavorite, key, lastPayout, numNominators, rankOverall, stakedReturnCmp, validatorPayment } = info;
return (
<tr>
@ -108,6 +108,7 @@ function Validator ({ allSlashes, canSelect, filterName, info, isNominated, isSe
<td className='address all'>
<AddressSmall value={accountId} />
</td>
<td className='number media--1400'>{lastPayout && formatNumber(lastPayout)}</td>
<td className='number media--1200'>{numNominators || ''}</td>
<td className='number'>
{

View File

@ -221,6 +221,7 @@ function Targets ({ className = '', isInElection, ownStashes, targets: { avgStak
const header = useMemo(() => [
[t('validators'), 'start', 3],
[t('paid'), 'media--1400'],
...(SORT_KEYS as (keyof typeof labelsRef.current)[]).map((header) => [
<>{labelsRef.current[header]}<Icon icon={sortBy === header ? (sortFromMax ? 'chevron-down' : 'chevron-up') : 'minus'} /></>,
`${sorted ? `isClickable ${sortBy === header ? 'highlight--border' : ''} number` : 'number'} ${CLASSES[header] || ''}`,

View File

@ -53,6 +53,7 @@ export interface ValidatorInfo extends ValidatorInfoRank {
isFavorite: boolean;
isNominating: boolean;
key: string;
lastPayout?: BN;
numNominators: number;
rewardSplit: BN;
skipRewards: boolean;

View File

@ -103,6 +103,7 @@ function extractSingle (allAccounts: string[], derive: DeriveStakingElected | De
return isNominating || allAccounts.includes(nominator);
}, allAccounts.includes(key));
const isElected = !isWaitingDerive(derive) && derive.nextElected.some((e) => e.eq(accountId));
const lastPayout = stakingLedger.claimedRewards[stakingLedger.claimedRewards.length - 1];
return {
accountId,
@ -118,6 +119,7 @@ function extractSingle (allAccounts: string[], derive: DeriveStakingElected | De
isFavorite: favorites.includes(key),
isNominating,
key,
lastPayout,
numNominators: (exposure.others || []).length,
rankBondOther: 0,
rankBondOwn: 0,