From 9f442698a45bc6440539f73304559d40482ad089 Mon Sep 17 00:00:00 2001 From: Matthew Russell Date: Mon, 8 May 2023 09:29:29 -0700 Subject: [PATCH] fix(explorer): network params fixture lookup for updateAsset proposals (#3633) --- .../src/fixtures/net_parameter_format_lookup.json | 6 +++--- .../network-parameters/network-parameters.tsx | 1 + .../src/lib/commands/get-network-parameters.ts | 15 +++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/explorer-e2e/src/fixtures/net_parameter_format_lookup.json b/apps/explorer-e2e/src/fixtures/net_parameter_format_lookup.json index da205bab0..f359d88e7 100644 --- a/apps/explorer-e2e/src/fixtures/net_parameter_format_lookup.json +++ b/apps/explorer-e2e/src/fixtures/net_parameter_format_lookup.json @@ -10,6 +10,8 @@ "governance.proposal.updateMarket.minVoterBalance", "governance.proposal.updateNetParam.minProposerBalance", "governance.proposal.updateNetParam.minVoterBalance", + "governance.proposal.updateAsset.minProposerBalance", + "governance.proposal.updateAsset.minVoterBalance", "reward.staking.delegation.maxPayoutPerEpoch", "reward.staking.delegation.maxPayoutPerParticipant", "reward.staking.delegation.minimumValidatorStake", @@ -19,9 +21,6 @@ "validators.delegation.minAmount" ], "fiveDecimal": [ - "governance.proposal.updateAsset.minProposerBalance", - "governance.proposal.updateAsset.minVoterBalance", - "governance.proposal.updateAsset.requiredParticipation", "market.fee.factors.infrastructureFee", "market.fee.factors.makerFee", "market.liquidity.bondPenaltyParameter", @@ -77,6 +76,7 @@ "governance.proposal.updateNetParam.requiredMajority", "governance.proposal.updateNetParam.requiredParticipation", "governance.proposal.updateMarket.minProposerEquityLikeShare", + "governance.proposal.updateAsset.requiredParticipation", "validators.vote.required" ], "duration": [ diff --git a/apps/explorer/src/app/routes/network-parameters/network-parameters.tsx b/apps/explorer/src/app/routes/network-parameters/network-parameters.tsx index 84bffe631..8eb9522a0 100644 --- a/apps/explorer/src/app/routes/network-parameters/network-parameters.tsx +++ b/apps/explorer/src/app/routes/network-parameters/network-parameters.tsx @@ -21,6 +21,7 @@ import { useDocumentTitle } from '../../hooks/use-document-title'; const PERCENTAGE_PARAMS = [ 'governance.proposal.asset.requiredMajority', 'governance.proposal.asset.requiredParticipation', + 'governance.proposal.updateAsset.requiredParticipation', 'governance.proposal.freeform.requiredMajority', 'governance.proposal.freeform.requiredParticipation', 'governance.proposal.market.requiredMajority', diff --git a/libs/cypress/src/lib/commands/get-network-parameters.ts b/libs/cypress/src/lib/commands/get-network-parameters.ts index 1f12d67d6..7505daa40 100644 --- a/libs/cypress/src/lib/commands/get-network-parameters.ts +++ b/libs/cypress/src/lib/commands/get-network-parameters.ts @@ -9,9 +9,8 @@ declare global { } export function addGetNetworkParameters() { - // @ts-ignore - ignoring Cypress type error which gets resolved when Cypress uses the command Cypress.Commands.add('get_network_parameters', () => { - const mutation = ` + const query = ` { networkParametersConnection { edges { @@ -26,17 +25,17 @@ export function addGetNetworkParameters() { method: 'POST', url: `http://localhost:3008/graphql`, body: { - query: mutation, + query, }, headers: { 'content-type': 'application/json' }, }) .its('body.data.networkParametersConnection.edges') .then(function (response) { - // @ts-ignore - ignoring Cypress type error which gets resolved when Cypress uses the command - const object = response.reduce(function (r, e) { - const { value, key } = e.node; - r[key] = value; - return r; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const object = response.reduce(function (obj: any, edge: any) { + const { value, key } = edge.node; + obj[key] = value; + return obj; }, {}); return cy.wrap(object); });