diff --git a/apps/explorer-e2e/src/integration/validator.cy.js b/apps/explorer-e2e/src/integration/validator.cy.js index 62ab2c65a..685257b9e 100644 --- a/apps/explorer-e2e/src/integration/validator.cy.js +++ b/apps/explorer-e2e/src/integration/validator.cy.js @@ -7,7 +7,11 @@ context('Validator page', { tags: '@smoke' }, function () { it('should be able to see validator tiles', function () { cy.getNodes().then((nodes) => { nodes.forEach((node) => { - cy.get(`[validator-id="${node.id}"]`).should('be.visible'); + if (node.rankingScore.performanceScore > 0) { + cy.get(`[validator-id="${node.id}"]`).should('be.visible'); + } else { + cy.get(`[validator-id="${node.id}"]`).should('not.exist'); + } }); }); }); diff --git a/apps/explorer/src/app/routes/validators/Nodes.graphql b/apps/explorer/src/app/routes/validators/Nodes.graphql index 60c728722..48eb0b8db 100644 --- a/apps/explorer/src/app/routes/validators/Nodes.graphql +++ b/apps/explorer/src/app/routes/validators/Nodes.graphql @@ -15,6 +15,9 @@ query ExplorerNodes { stakedByDelegates stakedTotal pendingStake + rankingScore { + performanceScore + } epochData { total offline diff --git a/apps/explorer/src/app/routes/validators/__generated__/Nodes.ts b/apps/explorer/src/app/routes/validators/__generated__/Nodes.ts index f9cefa8f6..d0f62cd9f 100644 --- a/apps/explorer/src/app/routes/validators/__generated__/Nodes.ts +++ b/apps/explorer/src/app/routes/validators/__generated__/Nodes.ts @@ -6,7 +6,7 @@ const defaultOptions = {} as const; export type ExplorerNodesQueryVariables = Types.Exact<{ [key: string]: never; }>; -export type ExplorerNodesQuery = { __typename?: 'Query', nodesConnection: { __typename?: 'NodesConnection', edges?: Array<{ __typename?: 'NodeEdge', node: { __typename?: 'Node', id: string, name: string, infoUrl: string, avatarUrl?: string | null, pubkey: string, tmPubkey: string, ethereumAddress: string, location: string, status: Types.NodeStatus, stakedByOperator: string, stakedByDelegates: string, stakedTotal: string, pendingStake: string, epochData?: { __typename?: 'EpochData', total: number, offline: number, online: number } | null } } | null> | null } }; +export type ExplorerNodesQuery = { __typename?: 'Query', nodesConnection: { __typename?: 'NodesConnection', edges?: Array<{ __typename?: 'NodeEdge', node: { __typename?: 'Node', id: string, name: string, infoUrl: string, avatarUrl?: string | null, pubkey: string, tmPubkey: string, ethereumAddress: string, location: string, status: Types.NodeStatus, stakedByOperator: string, stakedByDelegates: string, stakedTotal: string, pendingStake: string, rankingScore: { __typename?: 'RankingScore', performanceScore: string }, epochData?: { __typename?: 'EpochData', total: number, offline: number, online: number } | null } } | null> | null } }; export const ExplorerNodesDocument = gql` @@ -27,6 +27,9 @@ export const ExplorerNodesDocument = gql` stakedByDelegates stakedTotal pendingStake + rankingScore { + performanceScore + } epochData { total offline diff --git a/apps/explorer/src/app/routes/validators/validators-page.tsx b/apps/explorer/src/app/routes/validators/validators-page.tsx index d6108c224..3c2d888bc 100644 --- a/apps/explorer/src/app/routes/validators/validators-page.tsx +++ b/apps/explorer/src/app/routes/validators/validators-page.tsx @@ -91,7 +91,15 @@ export const ValidatorsPage = () => { const { data: tmData } = useTendermintValidators(5000); const { data, loading, error, refetch } = useExplorerNodesQuery(); - const validators = compact(data?.nodesConnection.edges?.map((e) => e?.node)); + const validators = compact( + data?.nodesConnection.edges + ?.map((e) => e?.node) + .filter( + (node) => + node?.rankingScore?.performanceScore && + new BigNumber(node.rankingScore.performanceScore).isGreaterThan(0) + ) + ); // voting power const powers = compact(tmData?.result.validators).map( diff --git a/libs/cypress/src/lib/commands/get-nodes.ts b/libs/cypress/src/lib/commands/get-nodes.ts index 454ad1aba..ef409a381 100644 --- a/libs/cypress/src/lib/commands/get-nodes.ts +++ b/libs/cypress/src/lib/commands/get-nodes.ts @@ -29,6 +29,9 @@ export function addGetNodes() { location name pendingStake + rankingScore { + performanceScore + } pubkey stakedByDelegates stakedByOperator