fix(explorer): network params fixture lookup for updateAsset proposals (#3633)

This commit is contained in:
Matthew Russell 2023-05-08 09:29:29 -07:00 committed by GitHub
parent d1265a6af7
commit 9f442698a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -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": [

View File

@ -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',

View File

@ -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);
});