fix: remove validatingnodes from all queries (#2199)

* fix: remove validatingnodes from all queries

* fix(explorer-e2e): remove assertion on validatingnodes
This commit is contained in:
Edd 2022-11-23 13:36:18 +00:00 committed by GitHub
parent 0a0d74dcbd
commit 22c1a4ad6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 26 additions and 47 deletions

View File

@ -18,22 +18,21 @@ context('Home Page', function () {
const statTitles = { const statTitles = {
0: 'Status', 0: 'Status',
1: 'Height', 1: 'Height',
2: 'Validating nodes', 2: 'Uptime',
3: 'Uptime', 3: 'Total nodes',
4: 'Total nodes', 4: 'Inactive nodes',
5: 'Inactive nodes', 5: 'Total staked',
6: 'Total staked', 6: 'Backlog',
7: 'Backlog', 7: 'Trades / second',
8: 'Trades / second', 8: 'Orders / block',
9: 'Orders / block', 9: 'Orders / second',
10: 'Orders / second', 10: 'Transactions / block',
11: 'Transactions / block', 11: 'Block time',
12: 'Block time', 12: 'Time',
13: 'Time', 13: 'App',
14: 'App', 14: 'Tendermint',
15: 'Tendermint', 15: 'Up since',
16: 'Up since', 16: 'Chain ID',
17: 'Chain ID',
}; };
cy.get('[data-testid="stats-title"]') cy.get('[data-testid="stats-title"]')
@ -41,41 +40,40 @@ context('Home Page', function () {
cy.wrap($list).should('have.text', statTitles[index]); cy.wrap($list).should('have.text', statTitles[index]);
}) })
.then(($list) => { .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(0).should('have.text', 'CONNECTED');
cy.get(statsValue).eq(1).should('not.be.empty'); cy.get(statsValue).eq(1).should('not.be.empty');
cy.get(statsValue).eq(2).should('have.text', '2');
cy.get(statsValue) cy.get(statsValue)
.eq(3) .eq(2)
.invoke('text') .invoke('text')
.should('match', /\d+d \d+h \d+m \d+s/i); .should('match', /\d+d \d+h \d+m \d+s/i);
cy.get(statsValue).eq(4).should('have.text', '2'); cy.get(statsValue).eq(3).should('have.text', '2');
cy.get(statsValue).eq(5).should('have.text', '0'); cy.get(statsValue).eq(4).should('have.text', '0');
cy.get(statsValue) cy.get(statsValue)
.eq(6) .eq(5)
.invoke('text') .invoke('text')
.should('match', /\d+\.\d\d(?!\d)/i); .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(7).should('have.text', '0');
cy.get(statsValue).eq(8).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(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(11).should('not.be.empty');
cy.get(statsValue).eq(12).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) { if (Cypress.env('NIGHTLY_RUN') != true) {
cy.get(statsValue) cy.get(statsValue)
.eq(14) .eq(13)
.invoke('text') .invoke('text')
.should('match', /v\d+\.\d+\.\d+/i); .should('match', /v\d+\.\d+\.\d+/i);
} }
cy.get(statsValue) cy.get(statsValue)
.eq(15) .eq(14)
.invoke('text') .invoke('text')
.should('match', /\d+\.\d+\.\d+/i); .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(16).should('not.be.empty');
cy.get(statsValue).eq(17).should('not.be.empty');
}); });
it('Block height should be updating', function () { it('Block height should be updating', function () {

View File

@ -77,7 +77,6 @@ const MOCK_NODES = {
stakedTotal: '27842509718651285145924', stakedTotal: '27842509718651285145924',
totalNodes: 3, totalNodes: 3,
inactiveNodes: 0, inactiveNodes: 0,
validatingNodes: 3,
uptime: 1560.266845703125, uptime: 1560.266845703125,
__typename: 'NodeData', __typename: 'NodeData',
}, },
@ -177,7 +176,6 @@ describe('Nodes list', () => {
stakedTotal: '9618711883996159534058', stakedTotal: '9618711883996159534058',
totalNodes: 1, totalNodes: 1,
inactiveNodes: 0, inactiveNodes: 0,
validatingNodes: 1,
uptime: 1560.266845703125, uptime: 1560.266845703125,
__typename: 'NodeData', __typename: 'NodeData',
}, },

View File

@ -60,7 +60,6 @@ query Staking($partyId: ID!) {
stakedTotal stakedTotal
totalNodes totalNodes
inactiveNodes inactiveNodes
validatingNodes
uptime uptime
} }
} }

View File

@ -76,7 +76,6 @@ export const StakingDocument = gql`
stakedTotal stakedTotal
totalNodes totalNodes
inactiveNodes inactiveNodes
validatingNodes
uptime uptime
} }
} }

View File

@ -3,7 +3,6 @@ query Stats {
stakedTotal stakedTotal
totalNodes totalNodes
inactiveNodes inactiveNodes
validatingNodes
} }
statistics { statistics {
status status

View File

@ -15,7 +15,6 @@ export const StatsDocument = gql`
stakedTotal stakedTotal
totalNodes totalNodes
inactiveNodes inactiveNodes
validatingNodes
} }
statistics { statistics {
status status

View File

@ -48,13 +48,6 @@ export const statsFields: { [key in keyof Stats]: StatFields[] } = {
description: t('The total number of nodes registered on the network'), 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: [ inactiveNodes: [
{ {
title: t('Inactive nodes'), title: t('Inactive nodes'),

View File

@ -1,11 +1,7 @@
import type { Schema } from '@vegaprotocol/types'; import type { Schema } from '@vegaprotocol/types';
import type { StatsQuery } from '../components/stats-manager/__generated__/Stats'; import type { StatsQuery } from '../components/stats-manager/__generated__/Stats';
type NodeDataKeys = type NodeDataKeys = 'stakedTotal' | 'totalNodes' | 'inactiveNodes';
| 'stakedTotal'
| 'totalNodes'
| 'inactiveNodes'
| 'validatingNodes';
export type Stats = Pick<Schema.NodeData, NodeDataKeys> & export type Stats = Pick<Schema.NodeData, NodeDataKeys> &
Omit<StatsQuery['statistics'], '__typename'>; Omit<StatsQuery['statistics'], '__typename'>;

View File

@ -1947,8 +1947,6 @@ export type NodeData = {
totalNodes: Scalars['Int']; totalNodes: Scalars['Int'];
/** Total uptime for all epochs across all nodes. Or specify a number of epochs */ /** Total uptime for all epochs across all nodes. Or specify a number of epochs */
uptime: Scalars['Float']; uptime: Scalars['Float'];
/** Number of nodes validating */
validatingNodes: Scalars['Int'];
}; };
/** Edge type containing the node and cursor information returned by a NodesConnection */ /** Edge type containing the node and cursor information returned by a NodesConnection */