From 22c1a4ad6a4d32314cb630b4e9af6f5fa2050d82 Mon Sep 17 00:00:00 2001 From: Edd Date: Wed, 23 Nov 2022 13:36:18 +0000 Subject: [PATCH] fix: remove validatingnodes from all queries (#2199) * fix: remove validatingnodes from all queries * fix(explorer-e2e): remove assertion on validatingnodes --- apps/explorer-e2e/src/integration/home.cy.js | 52 +++++++++---------- .../routes/staking/home/node-list.spec.tsx | 2 - .../src/routes/staking/node/Staking.graphql | 1 - .../staking/node/__generated___/Staking.ts | 1 - .../components/stats-manager/Stats.graphql | 1 - .../stats-manager/__generated__/Stats.ts | 1 - libs/network-stats/src/config/stats-fields.ts | 7 --- libs/network-stats/src/config/types.ts | 6 +-- libs/types/src/__generated__/types.ts | 2 - 9 files changed, 26 insertions(+), 47 deletions(-) diff --git a/apps/explorer-e2e/src/integration/home.cy.js b/apps/explorer-e2e/src/integration/home.cy.js index d57f223a9..7d77acb38 100644 --- a/apps/explorer-e2e/src/integration/home.cy.js +++ b/apps/explorer-e2e/src/integration/home.cy.js @@ -18,22 +18,21 @@ context('Home Page', function () { const statTitles = { 0: 'Status', 1: 'Height', - 2: 'Validating nodes', - 3: 'Uptime', - 4: 'Total nodes', - 5: 'Inactive nodes', - 6: 'Total staked', - 7: 'Backlog', - 8: 'Trades / second', - 9: 'Orders / block', - 10: 'Orders / second', - 11: 'Transactions / block', - 12: 'Block time', - 13: 'Time', - 14: 'App', - 15: 'Tendermint', - 16: 'Up since', - 17: 'Chain ID', + 2: 'Uptime', + 3: 'Total nodes', + 4: 'Inactive nodes', + 5: 'Total staked', + 6: 'Backlog', + 7: 'Trades / second', + 8: 'Orders / block', + 9: 'Orders / second', + 10: 'Transactions / block', + 11: 'Block time', + 12: 'Time', + 13: 'App', + 14: 'Tendermint', + 15: 'Up since', + 16: 'Chain ID', }; cy.get('[data-testid="stats-title"]') @@ -41,41 +40,40 @@ context('Home Page', function () { cy.wrap($list).should('have.text', statTitles[index]); }) .then(($list) => { - cy.wrap($list).should('have.length', 18); + cy.wrap($list).should('have.length', 17); }); cy.get(statsValue).eq(0).should('have.text', 'CONNECTED'); cy.get(statsValue).eq(1).should('not.be.empty'); - cy.get(statsValue).eq(2).should('have.text', '2'); cy.get(statsValue) - .eq(3) + .eq(2) .invoke('text') .should('match', /\d+d \d+h \d+m \d+s/i); - cy.get(statsValue).eq(4).should('have.text', '2'); - cy.get(statsValue).eq(5).should('have.text', '0'); + cy.get(statsValue).eq(3).should('have.text', '2'); + cy.get(statsValue).eq(4).should('have.text', '0'); cy.get(statsValue) - .eq(6) + .eq(5) .invoke('text') .should('match', /\d+\.\d\d(?!\d)/i); + cy.get(statsValue).eq(6).should('have.text', '0'); cy.get(statsValue).eq(7).should('have.text', '0'); cy.get(statsValue).eq(8).should('have.text', '0'); cy.get(statsValue).eq(9).should('have.text', '0'); - cy.get(statsValue).eq(10).should('have.text', '0'); + cy.get(statsValue).eq(10).should('not.be.empty'); cy.get(statsValue).eq(11).should('not.be.empty'); cy.get(statsValue).eq(12).should('not.be.empty'); - cy.get(statsValue).eq(13).should('not.be.empty'); if (Cypress.env('NIGHTLY_RUN') != true) { cy.get(statsValue) - .eq(14) + .eq(13) .invoke('text') .should('match', /v\d+\.\d+\.\d+/i); } cy.get(statsValue) - .eq(15) + .eq(14) .invoke('text') .should('match', /\d+\.\d+\.\d+/i); + cy.get(statsValue).eq(15).should('not.be.empty'); cy.get(statsValue).eq(16).should('not.be.empty'); - cy.get(statsValue).eq(17).should('not.be.empty'); }); it('Block height should be updating', function () { diff --git a/apps/token/src/routes/staking/home/node-list.spec.tsx b/apps/token/src/routes/staking/home/node-list.spec.tsx index 6d4a5b389..85ddefd1d 100644 --- a/apps/token/src/routes/staking/home/node-list.spec.tsx +++ b/apps/token/src/routes/staking/home/node-list.spec.tsx @@ -77,7 +77,6 @@ const MOCK_NODES = { stakedTotal: '27842509718651285145924', totalNodes: 3, inactiveNodes: 0, - validatingNodes: 3, uptime: 1560.266845703125, __typename: 'NodeData', }, @@ -177,7 +176,6 @@ describe('Nodes list', () => { stakedTotal: '9618711883996159534058', totalNodes: 1, inactiveNodes: 0, - validatingNodes: 1, uptime: 1560.266845703125, __typename: 'NodeData', }, diff --git a/apps/token/src/routes/staking/node/Staking.graphql b/apps/token/src/routes/staking/node/Staking.graphql index 35a9857bf..b36ecdaec 100644 --- a/apps/token/src/routes/staking/node/Staking.graphql +++ b/apps/token/src/routes/staking/node/Staking.graphql @@ -60,7 +60,6 @@ query Staking($partyId: ID!) { stakedTotal totalNodes inactiveNodes - validatingNodes uptime } } diff --git a/apps/token/src/routes/staking/node/__generated___/Staking.ts b/apps/token/src/routes/staking/node/__generated___/Staking.ts index efbb710e3..5d0baba96 100644 --- a/apps/token/src/routes/staking/node/__generated___/Staking.ts +++ b/apps/token/src/routes/staking/node/__generated___/Staking.ts @@ -76,7 +76,6 @@ export const StakingDocument = gql` stakedTotal totalNodes inactiveNodes - validatingNodes uptime } } diff --git a/libs/network-stats/src/components/stats-manager/Stats.graphql b/libs/network-stats/src/components/stats-manager/Stats.graphql index f84192eae..348d64156 100644 --- a/libs/network-stats/src/components/stats-manager/Stats.graphql +++ b/libs/network-stats/src/components/stats-manager/Stats.graphql @@ -3,7 +3,6 @@ query Stats { stakedTotal totalNodes inactiveNodes - validatingNodes } statistics { status diff --git a/libs/network-stats/src/components/stats-manager/__generated__/Stats.ts b/libs/network-stats/src/components/stats-manager/__generated__/Stats.ts index 5b31a2b3e..70daf3681 100644 --- a/libs/network-stats/src/components/stats-manager/__generated__/Stats.ts +++ b/libs/network-stats/src/components/stats-manager/__generated__/Stats.ts @@ -15,7 +15,6 @@ export const StatsDocument = gql` stakedTotal totalNodes inactiveNodes - validatingNodes } statistics { status diff --git a/libs/network-stats/src/config/stats-fields.ts b/libs/network-stats/src/config/stats-fields.ts index 42c894338..55cb003f7 100644 --- a/libs/network-stats/src/config/stats-fields.ts +++ b/libs/network-stats/src/config/stats-fields.ts @@ -48,13 +48,6 @@ export const statsFields: { [key in keyof Stats]: StatFields[] } = { description: t('The total number of nodes registered on the network'), }, ], - validatingNodes: [ - { - title: t('Validating nodes'), - promoted: true, - description: t('Nodes participating in consensus'), - }, - ], inactiveNodes: [ { title: t('Inactive nodes'), diff --git a/libs/network-stats/src/config/types.ts b/libs/network-stats/src/config/types.ts index e1f7f7f39..ab9280e2b 100644 --- a/libs/network-stats/src/config/types.ts +++ b/libs/network-stats/src/config/types.ts @@ -1,11 +1,7 @@ import type { Schema } from '@vegaprotocol/types'; import type { StatsQuery } from '../components/stats-manager/__generated__/Stats'; -type NodeDataKeys = - | 'stakedTotal' - | 'totalNodes' - | 'inactiveNodes' - | 'validatingNodes'; +type NodeDataKeys = 'stakedTotal' | 'totalNodes' | 'inactiveNodes'; export type Stats = Pick & Omit; diff --git a/libs/types/src/__generated__/types.ts b/libs/types/src/__generated__/types.ts index f99bb374e..64830953e 100644 --- a/libs/types/src/__generated__/types.ts +++ b/libs/types/src/__generated__/types.ts @@ -1947,8 +1947,6 @@ export type NodeData = { totalNodes: Scalars['Int']; /** Total uptime for all epochs across all nodes. Or specify a number of epochs */ uptime: Scalars['Float']; - /** Number of nodes validating */ - validatingNodes: Scalars['Int']; }; /** Edge type containing the node and cursor information returned by a NodesConnection */