Skip to content

Commit

Permalink
feat: Enable paged rewards on Kusama, disable missing_identity (#2088)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Bulat committed Apr 18, 2024
1 parent 0e2f2a1 commit dda72ef
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/config/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import BigNumber from 'bignumber.js';
// DEPRECATION: Paged Rewards
//
// Temporary until paged rewards migration has completed on all networks.
export const NetworksWithPagedRewards: NetworkName[] = ['westend'];
export const NetworksWithPagedRewards: NetworkName[] = ['westend', 'kusama'];
export const PagedRewardsStartEra: Record<NetworkName, BigNumber | null> = {
polkadot: null,
kusama: null,
kusama: new BigNumber(6514),
westend: new BigNumber(7167),
};

Expand Down
25 changes: 19 additions & 6 deletions src/library/GenerateNominations/useFetchMethods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export const useFetchMehods = () => {
// filter validators to find active candidates
filtered = applyFilter(
['active'],
['all_commission', 'blocked_nominations', 'missing_identity'],
[
'all_commission',
'blocked_nominations' /* 'missing_identity', NOTE: disabled until People chain supported */,
],
filtered
);

Expand Down Expand Up @@ -101,7 +104,7 @@ export const useFetchMehods = () => {
[
'all_commission',
'blocked_nominations',
'missing_identity',
/* 'missing_identity', NOTE: disabled until People chain supported */
'in_session',
],
waiting
Expand All @@ -110,7 +113,10 @@ export const useFetchMehods = () => {
// filter validators to find active candidates
active = applyFilter(
['active'],
['all_commission', 'blocked_nominations', 'missing_identity'],
[
'all_commission',
'blocked_nominations' /* 'missing_identity', NOTE: disabled until People chain supported */,
],
active
);

Expand Down Expand Up @@ -141,7 +147,8 @@ export const useFetchMehods = () => {
[
'all_commission',
'blocked_nominations',
'missing_identity',
/* 'missing_identity', NOTE: disabled until People chain supported */

'not_parachain_validator',
],
all
Expand All @@ -152,7 +159,10 @@ export const useFetchMehods = () => {
const active =
applyFilter(
['active'],
['all_commission', 'blocked_nominations', 'missing_identity'],
[
'all_commission',
'blocked_nominations' /* 'missing_identity', NOTE: disabled until People chain supported */,
],
all
).filter(
(n: Validator) => !nominations.find((o) => o.address === n.address)
Expand All @@ -166,7 +176,10 @@ export const useFetchMehods = () => {
const random =
applyFilter(
null,
['all_commission', 'blocked_nominations', 'missing_identity'],
[
'all_commission',
'blocked_nominations' /* 'missing_identity', NOTE: disabled until People chain supported */,
],
all
).filter(
(n: Validator) => !nominations.find((o) => o.address === n.address)
Expand Down
9 changes: 8 additions & 1 deletion src/library/ValidatorList/FilterValidators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ export const FilterValidators = () => {
const { getFilters, toggleFilter } = useFilters();
const { excludesToLabels, includesToLabels } = useValidatorFilters();

// Filtering missing_identity until People chain is supported.
const filteredExcludesToLabels = Object.fromEntries(
Object.entries(excludesToLabels).filter(
([key]) => key !== 'missing_identity'
)
);

const includes = getFilters('include', 'validators');
const excludes = getFilters('exclude', 'validators');

Expand All @@ -40,7 +47,7 @@ export const FilterValidators = () => {
))}

<h4>{t('exclude')}:</h4>
{Object.entries(excludesToLabels).map(([f, l], i) => (
{Object.entries(filteredExcludesToLabels).map(([f, l], i) => (
<FilterListButton
$active={excludes?.includes(f) ?? false}
key={`validator_exclude_${i}`}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Validators/AllValidators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const AllValidators = () => {
excludes: [
'all_commission',
'blocked_nominations',
'missing_identity',
/* 'missing_identity', NOTE: disabled until People chain supported */
],
}}
defaultOrder="rank"
Expand Down

0 comments on commit dda72ef

Please sign in to comment.