Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enable paged rewards on Kusama, disable missing_identity #2088

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading