Test/block exp network params (#1681)
* test: network parameter tests * test: lint * test: add comments * test: more guidance notes * test: disable theme check whilst investigating * test: fix failing test for console lite * test: attempt 2 to fix console lite error only in CI * test: lint * test: remove check * test: update conflict function
This commit is contained in:
parent
fb9505a8a8
commit
c3e70d6457
@ -296,11 +296,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
|
||||
|
||||
cy.get('#step-3-panel').find('dd').eq(4).should('have.text', ' - ');
|
||||
|
||||
cy.getByTestId('place-order').click();
|
||||
cy.getByTestId('dialog-title').should(
|
||||
'have.text',
|
||||
'Awaiting network confirmation'
|
||||
);
|
||||
cy.getByTestId('place-order').should('be.enabled').click();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -10,7 +10,7 @@ module.exports = defineConfig({
|
||||
},
|
||||
baseUrl: 'http://localhost:3000',
|
||||
fileServerFolder: '.',
|
||||
fixturesFolder: false,
|
||||
fixturesFolder: './src/fixtures',
|
||||
specPattern: '**/*.cy.{js,jsx,ts,tsx}',
|
||||
modifyObstructiveCode: false,
|
||||
supportFile: './src/support/index.js',
|
||||
|
121
apps/explorer-e2e/src/fixtures/net_parameter_format_lookup.json
Normal file
121
apps/explorer-e2e/src/fixtures/net_parameter_format_lookup.json
Normal file
@ -0,0 +1,121 @@
|
||||
{
|
||||
"eighteenDecimal": [
|
||||
"governance.proposal.asset.minProposerBalance",
|
||||
"governance.proposal.asset.minVoterBalance",
|
||||
"governance.proposal.freeform.minProposerBalance",
|
||||
"governance.proposal.freeform.minVoterBalance",
|
||||
"governance.proposal.market.minProposerBalance",
|
||||
"governance.proposal.market.minVoterBalance",
|
||||
"governance.proposal.updateMarket.minProposerBalance",
|
||||
"governance.proposal.updateMarket.minVoterBalance",
|
||||
"governance.proposal.updateNetParam.minProposerBalance",
|
||||
"governance.proposal.updateNetParam.minVoterBalance",
|
||||
"reward.staking.delegation.maxPayoutPerEpoch",
|
||||
"reward.staking.delegation.maxPayoutPerParticipant",
|
||||
"reward.staking.delegation.minimumValidatorStake",
|
||||
"spam.protection.delegation.min.tokens",
|
||||
"spam.protection.proposal.min.tokens",
|
||||
"spam.protection.voting.min.tokens",
|
||||
"validators.delegation.minAmount"
|
||||
],
|
||||
"fiveDecimal": [
|
||||
"governance.proposal.updateAsset.minProposerBalance",
|
||||
"governance.proposal.updateAsset.minVoterBalance",
|
||||
"governance.proposal.updateAsset.requiredParticipation",
|
||||
"governance.proposal.updateMarket.minProposerEquityLikeShare",
|
||||
"market.fee.factors.infrastructureFee",
|
||||
"market.fee.factors.makerFee",
|
||||
"market.liquidity.bondPenaltyParameter",
|
||||
"market.liquidity.maximumLiquidityFeeFactorLevel",
|
||||
"market.liquidity.minimum.probabilityOfTrading.lpOrders",
|
||||
"market.liquidity.probabilityOfTrading.tau.scaling",
|
||||
"market.liquidity.stakeToCcySiskas",
|
||||
"market.liquidity.targetstake.triggering.ratio",
|
||||
"market.liquidityProvision.minLpStakeQuantumMultiple",
|
||||
"market.liquidityProvision.shapes.maxSize",
|
||||
"market.stake.target.scalingFactor",
|
||||
"network.validators.ersatz.multipleOfTendermintValidators",
|
||||
"network.validators.ersatz.rewardFactor",
|
||||
"network.validators.incumbentBonus",
|
||||
"network.validators.minimumEthereumEventsForNewValidator",
|
||||
"network.validators.multisig.numberOfSigners",
|
||||
"network.validators.tendermint.number",
|
||||
"reward.staking.delegation.competitionLevel",
|
||||
"reward.staking.delegation.delegatorShare",
|
||||
"reward.staking.delegation.minValidators",
|
||||
"reward.staking.delegation.optimalStakeMultiplier",
|
||||
"reward.staking.delegation.payoutFraction",
|
||||
"rewards.marketCreationQuantumMultiple",
|
||||
"spam.pow.difficulty",
|
||||
"spam.pow.increaseDifficulty",
|
||||
"spam.pow.numberOfPastBlocks",
|
||||
"spam.pow.numberOfTxPerBlock",
|
||||
"spam.protection.max.batchSize",
|
||||
"spam.protection.max.delegations",
|
||||
"spam.protection.max.proposals",
|
||||
"spam.protection.max.votes",
|
||||
"spam.protection.maxUserTransfersPerEpoch",
|
||||
"transfer.fee.factor",
|
||||
"transfer.minTransferQuantumMultiple",
|
||||
"snapshot.interval.length"
|
||||
],
|
||||
"json": [
|
||||
"blockchains.ethereumConfig",
|
||||
"market.margin.scalingFactors",
|
||||
"market.monitor.price.defaultParameters"
|
||||
],
|
||||
"percentage": [
|
||||
"governance.proposal.asset.requiredMajority",
|
||||
"governance.proposal.asset.requiredParticipation",
|
||||
"governance.proposal.freeform.requiredMajority",
|
||||
"governance.proposal.freeform.requiredParticipation",
|
||||
"governance.proposal.market.requiredMajority",
|
||||
"governance.proposal.market.requiredParticipation",
|
||||
"governance.proposal.updateMarket.requiredMajority",
|
||||
"governance.proposal.updateMarket.requiredMajorityLP",
|
||||
"governance.proposal.updateMarket.requiredParticipation",
|
||||
"governance.proposal.updateMarket.requiredParticipationLP",
|
||||
"governance.proposal.updateNetParam.requiredMajority",
|
||||
"governance.proposal.updateNetParam.requiredParticipation",
|
||||
"validators.vote.required"
|
||||
],
|
||||
"duration": [
|
||||
"governance.proposal.asset.maxClose",
|
||||
"governance.proposal.asset.maxEnact",
|
||||
"governance.proposal.asset.minClose",
|
||||
"governance.proposal.asset.minEnact",
|
||||
"governance.proposal.freeform.maxClose",
|
||||
"governance.proposal.freeform.minClose",
|
||||
"governance.proposal.market.maxClose",
|
||||
"governance.proposal.market.maxEnact",
|
||||
"governance.proposal.market.minClose",
|
||||
"governance.proposal.market.minEnact",
|
||||
"governance.proposal.updateAsset.maxClose",
|
||||
"governance.proposal.updateAsset.maxEnact",
|
||||
"governance.proposal.updateAsset.minClose",
|
||||
"governance.proposal.updateAsset.minEnact",
|
||||
"governance.proposal.updateMarket.maxClose",
|
||||
"governance.proposal.updateMarket.maxEnact",
|
||||
"governance.proposal.updateMarket.minClose",
|
||||
"governance.proposal.updateMarket.minEnact",
|
||||
"governance.proposal.updateNetParam.maxClose",
|
||||
"governance.proposal.updateNetParam.maxEnact",
|
||||
"governance.proposal.updateNetParam.minClose",
|
||||
"governance.proposal.updateNetParam.minEnact",
|
||||
"market.auction.maximumDuration",
|
||||
"market.auction.minimumDuration",
|
||||
"market.liquidity.providers.fee.distributionTimeStep",
|
||||
"market.stake.target.timeWindow",
|
||||
"market.value.windowLength",
|
||||
"network.checkpoint.timeElapsedBetweenCheckpoints",
|
||||
"network.floatingPointUpdates.delay",
|
||||
"reward.staking.delegation.payoutDelay",
|
||||
"spam.pow.hashFunction",
|
||||
"validators.epoch.length"
|
||||
],
|
||||
"date": [
|
||||
"limits.assets.proposeEnabledFrom",
|
||||
"limits.markets.proposeEnabledFrom"
|
||||
],
|
||||
"id": ["reward.asset"]
|
||||
}
|
@ -1,33 +1,257 @@
|
||||
context('Network parameters page', { tags: '@smoke' }, function () {
|
||||
before('visit token home page', function () {
|
||||
cy.visit('/');
|
||||
before('navigate to network parameter page', function () {
|
||||
cy.fixture('net_parameter_format_lookup').as('networkParameterFormat');
|
||||
});
|
||||
|
||||
describe('Verify elements on page', function () {
|
||||
const networkParametersNavigation = 'a[href="/network-parameters"]';
|
||||
const networkParametersHeader = '[data-testid="network-param-header"]';
|
||||
const tableRows = '[data-testid="key-value-table-row"]';
|
||||
|
||||
beforeEach('Navigate to network parameter page', function () {
|
||||
before('navigate to network parameter page', function () {
|
||||
cy.visit('/');
|
||||
cy.get(networkParametersNavigation).click();
|
||||
});
|
||||
|
||||
it('Network paremeter page is displayed', function () {
|
||||
verifyNetworkParametersPageDisplayed();
|
||||
it('should show network parameter heading at top of page', function () {
|
||||
cy.get(networkParametersHeader)
|
||||
.should('have.text', 'Network Parameters')
|
||||
.and('be.visible');
|
||||
});
|
||||
|
||||
it('Network parameter page displayed on mobile', function () {
|
||||
it('should list each of the network parameters available', function () {
|
||||
cy.get_network_parameters().then((network_parameters) => {
|
||||
const numberOfNetworkParametersInSystem =
|
||||
Object.keys(network_parameters).length;
|
||||
cy.get(tableRows).should(
|
||||
'have.length',
|
||||
numberOfNetworkParametersInSystem
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('should list each network parameter displayed with json - in the correct format', function () {
|
||||
cy.get_network_parameters().then((network_parameters) => {
|
||||
network_parameters = Object.entries(network_parameters);
|
||||
network_parameters.forEach((network_parameter) => {
|
||||
const parameterName = network_parameter[0];
|
||||
const parameterValue = network_parameter[1];
|
||||
if (this.networkParameterFormat.json.includes(parameterName)) {
|
||||
cy.get(tableRows)
|
||||
.contains(parameterName)
|
||||
.should('be.visible')
|
||||
.next()
|
||||
.invoke('text')
|
||||
.convert_string_json_to_js_object()
|
||||
.then((jsonOnPage) => {
|
||||
cy.wrap(parameterValue, { log: false })
|
||||
.convert_string_json_to_js_object()
|
||||
.then((jsonInSystem) =>
|
||||
assert.deepEqual(
|
||||
jsonOnPage,
|
||||
jsonInSystem,
|
||||
`Checking ${parameterName} has the correct value of ${jsonInSystem}`
|
||||
)
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should list each network parameter displayed as a percentage - in the correct format', function () {
|
||||
cy.get_network_parameters().then((network_parameters) => {
|
||||
network_parameters = Object.entries(network_parameters);
|
||||
network_parameters.forEach((network_parameter) => {
|
||||
const parameterName = network_parameter[0];
|
||||
const parameterValue = network_parameter[1];
|
||||
if (this.networkParameterFormat.percentage.includes(parameterName)) {
|
||||
const formattedPercentageParameter =
|
||||
(parseFloat(parameterValue) * 100).toFixed(0) + '%';
|
||||
cy.get(tableRows)
|
||||
.contains(parameterName)
|
||||
.should('be.visible')
|
||||
.next()
|
||||
.invoke('text')
|
||||
.then((parameterValueOnPage) => {
|
||||
assert.equal(
|
||||
parameterValueOnPage,
|
||||
formattedPercentageParameter,
|
||||
`Checking ${parameterName} has the correct value of ${formattedPercentageParameter}`
|
||||
);
|
||||
cy.contains(parameterValueOnPage).should('be.visible');
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should list each network parameter displayed as an id - in the correct format', function () {
|
||||
cy.get_network_parameters().then((network_parameters) => {
|
||||
network_parameters = Object.entries(network_parameters);
|
||||
network_parameters.forEach((network_parameter) => {
|
||||
const parameterName = network_parameter[0];
|
||||
const parameterValue = network_parameter[1];
|
||||
if (this.networkParameterFormat.id.includes(parameterName)) {
|
||||
cy.get(tableRows)
|
||||
.contains(parameterName)
|
||||
.should('be.visible')
|
||||
.next()
|
||||
.should('contain', parameterValue)
|
||||
.and('be.visible')
|
||||
.invoke('text');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should list each network parameter displayed as a date - in the correct format', function () {
|
||||
cy.get_network_parameters().then((network_parameters) => {
|
||||
network_parameters = Object.entries(network_parameters);
|
||||
network_parameters.forEach((network_parameter) => {
|
||||
const parameterName = network_parameter[0];
|
||||
const parameterValue = network_parameter[1];
|
||||
if (this.networkParameterFormat.date.includes(parameterName)) {
|
||||
cy.get(tableRows)
|
||||
.contains(parameterName)
|
||||
.should('be.visible')
|
||||
.next()
|
||||
.should('contain', parameterValue)
|
||||
.and('be.visible');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should list each network parameter displayed as a duration - in the correct format', function () {
|
||||
cy.get_network_parameters().then((network_parameters) => {
|
||||
network_parameters = Object.entries(network_parameters);
|
||||
network_parameters.forEach((network_parameter) => {
|
||||
const parameterName = network_parameter[0];
|
||||
const parameterValue = network_parameter[1];
|
||||
if (this.networkParameterFormat.duration.includes(parameterName)) {
|
||||
cy.get(tableRows)
|
||||
.contains(parameterName)
|
||||
.should('be.visible')
|
||||
.next()
|
||||
.should('contain', parameterValue)
|
||||
.and('be.visible');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should list each network parameter displayed as a currency value with four decimals - in the correct format', function () {
|
||||
cy.get_network_parameters().then((network_parameters) => {
|
||||
network_parameters = Object.entries(network_parameters);
|
||||
network_parameters.forEach((network_parameter) => {
|
||||
const parameterName = network_parameter[0];
|
||||
const parameterValue = network_parameter[1];
|
||||
if (this.networkParameterFormat.fiveDecimal.includes(parameterName)) {
|
||||
cy.convert_number_to_four_decimal(parameterValue)
|
||||
.add_commas_to_number_if_large_enough()
|
||||
.then((parameterValueFormatted) => {
|
||||
cy.get(tableRows)
|
||||
.contains(parameterName)
|
||||
.should('be.visible')
|
||||
.next()
|
||||
.invoke('text')
|
||||
.then((parameterValueOnPage) => {
|
||||
assert.equal(
|
||||
parameterValueOnPage,
|
||||
parameterValueFormatted,
|
||||
`Checking ${parameterName} has the correct value of ${parameterValueFormatted}`
|
||||
);
|
||||
cy.contains(parameterValueOnPage).should('be.visible');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should list each network parameter displayed as a currency value with eighteen decimals - in the correct format', function () {
|
||||
cy.get_network_parameters().then((network_parameters) => {
|
||||
network_parameters = Object.entries(network_parameters);
|
||||
network_parameters.forEach((network_parameter) => {
|
||||
const parameterName = network_parameter[0];
|
||||
const parameterValue = network_parameter[1];
|
||||
if (
|
||||
this.networkParameterFormat.eighteenDecimal.includes(parameterName)
|
||||
) {
|
||||
cy.convert_number_to_eighteen_decimal(parameterValue)
|
||||
.add_commas_to_number_if_large_enough()
|
||||
.then((parameterValueFormatted) => {
|
||||
cy.get(tableRows)
|
||||
.contains(parameterName)
|
||||
.should('be.visible')
|
||||
.next()
|
||||
.invoke('text')
|
||||
.then((parameterValueOnPage) => {
|
||||
assert.equal(
|
||||
parameterValueOnPage,
|
||||
parameterValueFormatted,
|
||||
`Checking ${parameterName} has the correct value of ${parameterValueFormatted}`
|
||||
);
|
||||
cy.contains(parameterValueOnPage).should('be.visible');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it.skip('should be able to switch network parameter page - between light and dark mode', function () {
|
||||
const whiteThemeSelectedMenuOptionColor = 'rgb(255, 7, 127)';
|
||||
const whiteThemeJsonFieldBackColor = 'rgb(255, 255, 255)';
|
||||
const whiteThemeSideMenuBackgroundColor = 'rgb(255, 255, 255)';
|
||||
const blackThemeSelectedMenuOptionColor = 'rgb(223, 255, 11)';
|
||||
const blackThemeJsonFieldBackColor = 'rgb(38, 38, 38)';
|
||||
const blackThemeSideMenuBackgroundColor = 'rgb(0, 0, 0)';
|
||||
const themeSwitcher = '[data-testid="theme-switcher"]';
|
||||
const jsonFields = '.hljs';
|
||||
const sideMenuBackground = '.absolute';
|
||||
|
||||
// White Mode
|
||||
cy.get(themeSwitcher).click();
|
||||
cy.get(networkParametersNavigation)
|
||||
.should('have.css', 'background-color')
|
||||
.and('include', whiteThemeSelectedMenuOptionColor);
|
||||
cy.get(jsonFields)
|
||||
.should('have.css', 'background-color')
|
||||
.and('include', whiteThemeJsonFieldBackColor);
|
||||
cy.get(sideMenuBackground)
|
||||
.should('have.css', 'background-color')
|
||||
.and('include', whiteThemeSideMenuBackgroundColor);
|
||||
|
||||
// Dark Mode
|
||||
cy.get(themeSwitcher).click();
|
||||
cy.get(networkParametersNavigation)
|
||||
.should('have.css', 'background-color')
|
||||
.and('include', blackThemeSelectedMenuOptionColor);
|
||||
cy.get(jsonFields)
|
||||
.should('have.css', 'background-color')
|
||||
.and('include', blackThemeJsonFieldBackColor);
|
||||
cy.get(sideMenuBackground)
|
||||
.should('have.css', 'background-color')
|
||||
.and('include', blackThemeSideMenuBackgroundColor);
|
||||
});
|
||||
|
||||
it('should be able to see network parameters - on mobile', function () {
|
||||
cy.common_switch_to_mobile_and_click_toggle();
|
||||
cy.get(networkParametersNavigation).click();
|
||||
verifyNetworkParametersPageDisplayed();
|
||||
cy.get_network_parameters().then((network_parameters) => {
|
||||
network_parameters = Object.entries(network_parameters);
|
||||
network_parameters.forEach((network_parameter) => {
|
||||
const parameterName = network_parameter[0];
|
||||
cy.get(tableRows)
|
||||
.contains(parameterName)
|
||||
.should('be.visible')
|
||||
.next()
|
||||
.should('not.be.empty')
|
||||
.and('be.visible');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function verifyNetworkParametersPageDisplayed() {
|
||||
cy.get('[data-testid="network-param-header"]').should(
|
||||
'have.text',
|
||||
'Network Parameters'
|
||||
);
|
||||
cy.common_verify_json_parameters(18);
|
||||
cy.common_verify_json_string_values(6);
|
||||
cy.common_verify_json_int_values(7);
|
||||
}
|
||||
});
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { BigNumber } from 'bignumber.js';
|
||||
|
||||
Cypress.Commands.add(
|
||||
'common_validate_blocks_data_displayed',
|
||||
function (headerTestId) {
|
||||
@ -25,33 +27,6 @@ Cypress.Commands.add('common_switch_to_mobile_and_click_toggle', function () {
|
||||
cy.get('[data-testid="open-menu"]').click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('common_verify_json_parameters', function (expectedNum) {
|
||||
cy.get('.hljs-attr')
|
||||
.should('have.length.at.least', expectedNum)
|
||||
.each(($paramName) => {
|
||||
cy.wrap($paramName).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add(
|
||||
'common_verify_json_string_values',
|
||||
function (expectedNum) {
|
||||
cy.get('.hljs-string')
|
||||
.should('have.length.at.least', expectedNum)
|
||||
.each(($paramValue) => {
|
||||
cy.wrap($paramValue).should('not.be.empty');
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
Cypress.Commands.add('common_verify_json_int_values', function (expectedNum) {
|
||||
cy.get('.hljs-number')
|
||||
.should('have.length.at.least', expectedNum)
|
||||
.each(($paramValue) => {
|
||||
cy.wrap($paramValue).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('monitor_clipboard', () => {
|
||||
cy.window().then((win) => {
|
||||
return cy.stub(win, 'prompt').returns(win.prompt);
|
||||
@ -72,6 +47,33 @@ Cypress.Commands.add(
|
||||
'convert_string_json_to_js_object',
|
||||
{ prevSubject: true },
|
||||
(jsonBlobString) => {
|
||||
// Note: this is a chaining function
|
||||
return JSON.parse(jsonBlobString);
|
||||
}
|
||||
);
|
||||
|
||||
Cypress.Commands.add(
|
||||
'add_commas_to_number_if_large_enough',
|
||||
{ prevSubject: true },
|
||||
(number) => {
|
||||
// This will turn 10000000.0000 into 10,000,000.000
|
||||
// Note: this is a chaining function
|
||||
const beforeDecimal = number.split('.')[0];
|
||||
const afterDecimal = number.split('.')[1];
|
||||
const beforeDecimalWithCommas = beforeDecimal
|
||||
.toString()
|
||||
.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||
const formattedValue = beforeDecimalWithCommas + '.' + afterDecimal;
|
||||
return formattedValue;
|
||||
}
|
||||
);
|
||||
|
||||
Cypress.Commands.add('convert_number_to_eighteen_decimal', (number) => {
|
||||
// this will take a number like this : 700000000000000000000
|
||||
// and convert it to a number like this: 700.000000000000000000
|
||||
return BigNumber((number / 1000000000000000000).toString()).toFixed(18);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('convert_number_to_four_decimal', (number) => {
|
||||
return parseFloat(number).toFixed(4);
|
||||
});
|
||||
|
@ -73,27 +73,6 @@ Cypress.Commands.add('enter_unique_freeform_proposal_body', (timestamp) => {
|
||||
cy.get(proposalVoteDeadline).clear().click().type(timestamp);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('get_network_parameters', () => {
|
||||
let mutation = '{networkParameters {key value}}';
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: `http://localhost:3028/query`,
|
||||
body: {
|
||||
query: mutation,
|
||||
},
|
||||
headers: { 'content-type': 'application/json' },
|
||||
})
|
||||
.its(`body.data.networkParameters`)
|
||||
.then(function (response) {
|
||||
let object = response.reduce(function (r, e) {
|
||||
r[e.key] = e.value;
|
||||
return r;
|
||||
}, {});
|
||||
|
||||
return object;
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('get_submitted_proposal_from_proposal_list', () => {
|
||||
cy.wait('@proposalSubmissionCompletion')
|
||||
.its(proposalResponseProposalIdPath)
|
||||
|
@ -12,6 +12,7 @@ import { addVegaWalletReceiveFaucetedAsset } from './lib/commands/vega-wallet-re
|
||||
import { addVegaWalletImport } from './lib/commands/vega-wallet-import';
|
||||
import { addContainsExactly } from './lib/commands/contains-exactly';
|
||||
import { addRestartVegacapsuleNetwork } from './lib/commands/restart-vegacapsule-network';
|
||||
import { addGetNetworkParameters } from './lib/commands/get-network-parameters';
|
||||
|
||||
addGetTestIdcommand();
|
||||
addSlackCommand();
|
||||
@ -25,6 +26,7 @@ addGetAssetInformation();
|
||||
addVegaWalletImport();
|
||||
addContainsExactly();
|
||||
addRestartVegacapsuleNetwork();
|
||||
addGetNetworkParameters();
|
||||
|
||||
export * from './lib/graphql-test-utils';
|
||||
export type { onMessage } from './lib/commands/mock-gql';
|
||||
|
33
libs/cypress/src/lib/commands/get-network-parameters.ts
Normal file
33
libs/cypress/src/lib/commands/get-network-parameters.ts
Normal file
@ -0,0 +1,33 @@
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace Cypress {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
interface Chainable<Subject> {
|
||||
get_network_parameters(): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 = '{networkParameters {key value}}';
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: `http://localhost:3028/query`,
|
||||
body: {
|
||||
query: mutation,
|
||||
},
|
||||
headers: { 'content-type': 'application/json' },
|
||||
})
|
||||
.its('body.data.networkParameters')
|
||||
.then(function (response) {
|
||||
// @ts-ignore - ignoring Cypress type error which gets resolved when Cypress uses the command
|
||||
const object = response.reduce(function (r, e) {
|
||||
r[e.key] = e.value;
|
||||
return r;
|
||||
}, {});
|
||||
return object;
|
||||
});
|
||||
});
|
||||
}
|
@ -175,46 +175,114 @@
|
||||
},
|
||||
"network_parameters": {
|
||||
"blockchains.ethereumConfig": "{\"network_id\": \"{{ .NetworkID }}\", \"chain_id\": \"{{ .ChainID }}\", \"collateral_bridge_contract\": { \"address\": \"{{.GetEthContractAddr "erc20_bridge_1"}}\" }, \"confirmations\": 3, \"staking_bridge_contract\": { \"address\": \"{{.GetEthContractAddr "staking_bridge"}}\", \"deployment_block_height\": 0}, \"token_vesting_contract\": { \"address\": \"{{.GetEthContractAddr "erc20_vesting"}}\", \"deployment_block_height\": 0 }, \"multisig_control_contract\": { \"address\": \"{{.GetEthContractAddr "MultisigControl"}}\", \"deployment_block_height\": 0 }}",
|
||||
"governance.proposal.asset.minClose": "2s",
|
||||
"governance.proposal.asset.minEnact": "2s",
|
||||
"governance.proposal.asset.requiredParticipation": "0.00000000000000000000000015",
|
||||
"governance.proposal.freeform.minProposerBalance": "1",
|
||||
"governance.proposal.freeform.minVoterBalance": "1",
|
||||
"governance.proposal.freeform.requiredMajority": "0.66",
|
||||
"governance.proposal.freeform.requiredParticipation": "0.00001",
|
||||
"governance.proposal.freeform.maxClose": "8760h0m0s",
|
||||
"governance.proposal.freeform.minClose": "48h0m0s",
|
||||
"governance.proposal.market.minClose": "2s",
|
||||
"governance.proposal.market.minEnact": "2s",
|
||||
"governance.proposal.market.requiredParticipation": "0.00000000000000000000000015",
|
||||
"governance.proposal.updateMarket.minClose": "2s",
|
||||
"governance.proposal.updateMarket.minEnact": "2s",
|
||||
"governance.proposal.updateMarket.requiredParticipation": "0.00000000000000000000000015",
|
||||
"governance.proposal.updateNetParam.minClose": "2s",
|
||||
"governance.proposal.updateNetParam.minEnact": "2s",
|
||||
"governance.proposal.updateNetParam.requiredParticipation": "0.00000000000000000000000015",
|
||||
"market.auction.minimumDuration": "3s",
|
||||
"market.fee.factors.infrastructureFee": "0.001",
|
||||
"market.fee.factors.makerFee": "0.004",
|
||||
"market.liquidity.stakeToCcySiskas": "0.3",
|
||||
"market.liquidity.targetstake.triggering.ratio": "0.7",
|
||||
"governance.proposal.asset.maxClose":"8760h0m0s",
|
||||
"governance.proposal.asset.maxEnact":"8760h0m0s",
|
||||
"governance.proposal.asset.minClose":"2s",
|
||||
"governance.proposal.asset.minEnact":"2s",
|
||||
"governance.proposal.asset.minProposerBalance":"0",
|
||||
"governance.proposal.asset.minVoterBalance":"0",
|
||||
"governance.proposal.asset.requiredMajority":"0.66",
|
||||
"governance.proposal.asset.requiredParticipation":"0.00000000000000000000000015",
|
||||
"governance.proposal.freeform.maxClose":"8760h0m0s",
|
||||
"governance.proposal.freeform.minClose":"48h0m0s",
|
||||
"governance.proposal.freeform.minProposerBalance":"1",
|
||||
"governance.proposal.freeform.minVoterBalance":"1",
|
||||
"governance.proposal.freeform.requiredMajority":"0.66",
|
||||
"governance.proposal.freeform.requiredParticipation":"0.00001",
|
||||
"governance.proposal.market.maxClose":"8760h0m0s",
|
||||
"governance.proposal.market.maxEnact":"8760h0m0s",
|
||||
"governance.proposal.market.minClose":"2s",
|
||||
"governance.proposal.market.minEnact":"2s",
|
||||
"governance.proposal.market.minProposerBalance":"0",
|
||||
"governance.proposal.market.minVoterBalance":"0",
|
||||
"governance.proposal.market.requiredMajority":"0.66",
|
||||
"governance.proposal.market.requiredParticipation":"0.00000000000000000000000015",
|
||||
"governance.proposal.updateAsset.maxClose":"8760h0m0s",
|
||||
"governance.proposal.updateAsset.maxEnact":"8760h0m0s",
|
||||
"governance.proposal.updateAsset.minClose":"48h0m0s",
|
||||
"governance.proposal.updateAsset.minEnact":"48h0m0s",
|
||||
"governance.proposal.updateAsset.minProposerBalance":"0",
|
||||
"governance.proposal.updateAsset.minVoterBalance":"0",
|
||||
"governance.proposal.updateAsset.requiredMajority":"0.66",
|
||||
"governance.proposal.updateAsset.requiredParticipation":"0.00001",
|
||||
"governance.proposal.updateMarket.maxClose":"8760h0m0s",
|
||||
"governance.proposal.updateMarket.maxEnact":"8760h0m0s",
|
||||
"governance.proposal.updateMarket.minClose":"2s",
|
||||
"governance.proposal.updateMarket.minEnact":"2s",
|
||||
"governance.proposal.updateMarket.minProposerBalance":"0",
|
||||
"governance.proposal.updateMarket.minProposerEquityLikeShare":"0.66",
|
||||
"governance.proposal.updateMarket.minVoterBalance":"0",
|
||||
"governance.proposal.updateMarket.requiredMajority":"0.66",
|
||||
"governance.proposal.updateMarket.requiredMajorityLP":"0.66",
|
||||
"governance.proposal.updateMarket.requiredParticipation":"0.00000000000000000000000015",
|
||||
"governance.proposal.updateMarket.requiredParticipationLP":"0.00001",
|
||||
"governance.proposal.updateNetParam.maxClose":"8760h0m0s",
|
||||
"governance.proposal.updateNetParam.maxEnact":"8760h0m0s",
|
||||
"governance.proposal.updateNetParam.minClose":"2s",
|
||||
"governance.proposal.updateNetParam.minEnact":"2s",
|
||||
"governance.proposal.updateNetParam.minProposerBalance":"0",
|
||||
"governance.proposal.updateNetParam.minVoterBalance":"0",
|
||||
"governance.proposal.updateNetParam.requiredMajority":"0.66",
|
||||
"governance.proposal.updateNetParam.requiredParticipation":"0.00000000000000000000000015",
|
||||
"limits.assets.proposeEnabledFrom":"2100-12-30T00:00:00Z",
|
||||
"limits.markets.proposeEnabledFrom":"2100-12-30T00:00:00Z",
|
||||
"market.auction.maximumDuration":"168h0m0s",
|
||||
"market.auction.minimumDuration":"3s",
|
||||
"market.fee.factors.infrastructureFee":"0.001",
|
||||
"market.fee.factors.makerFee":"0.004",
|
||||
"market.liquidity.bondPenaltyParameter":"1",
|
||||
"market.liquidity.maximumLiquidityFeeFactorLevel":"1",
|
||||
"market.liquidity.minimum.probabilityOfTrading.lpOrders":"1e-8",
|
||||
"market.liquidity.probabilityOfTrading.tau.scaling":"1",
|
||||
"market.liquidity.providers.fee.distributionTimeStep":"0s",
|
||||
"market.liquidity.stakeToCcySiskas":"0.3",
|
||||
"market.liquidity.targetstake.triggering.ratio":"0.7",
|
||||
"market.liquidityProvision.minLpStakeQuantumMultiple":"1",
|
||||
"market.liquidityProvision.shapes.maxSize":"100",
|
||||
"market.margin.scalingFactors":"{\"search_level\": 1.1, \"initial_margin\": 1.2, \"collateral_release\": 1.4}",
|
||||
"market.monitor.price.defaultParameters":"{\"triggers\": []}",
|
||||
"market.stake.target.scalingFactor":"10",
|
||||
"market.stake.target.timeWindow":"1h0m0s",
|
||||
"market.value.windowLength":"168h0m0s",
|
||||
"network.checkpoint.timeElapsedBetweenCheckpoints":"10s",
|
||||
"network.floatingPointUpdates.delay":"5m",
|
||||
"network.validators.ersatz.multipleOfTendermintValidators":"0.5",
|
||||
"network.validators.ersatz.rewardFactor":"0.5",
|
||||
"network.validators.incumbentBonus":"1",
|
||||
"network.validators.minimumEthereumEventsForNewValidator":"3",
|
||||
"network.validators.multisig.numberOfSigners":"13",
|
||||
"network.validators.tendermint.number":"30",
|
||||
"network.checkpoint.timeElapsedBetweenCheckpoints": "10s",
|
||||
"reward.asset": "{{.GetVegaContractID "VEGA"}}",
|
||||
"reward.staking.delegation.competitionLevel": "3.1",
|
||||
"reward.staking.delegation.delegatorShare": "0.883",
|
||||
"reward.staking.delegation.maxPayoutPerParticipant": "700000000000000000000",
|
||||
"reward.staking.delegation.minimumValidatorStake": "3000000000000000000000",
|
||||
"reward.staking.delegation.payoutDelay": "5m",
|
||||
"reward.staking.delegation.payoutFraction": "0.007",
|
||||
"spam.protection.delegation.min.tokens": "1000000000000000000",
|
||||
"spam.protection.max.delegations": "390",
|
||||
"spam.protection.max.proposals": "100",
|
||||
"spam.protection.max.votes": "100",
|
||||
"spam.protection.proposal.min.tokens": "1000000000000000000",
|
||||
"spam.protection.voting.min.tokens": "1000000000000000000",
|
||||
"validators.delegation.minAmount": "100000000000000000",
|
||||
"validators.epoch.length": "5s",
|
||||
"validators.vote.required": "0.67"
|
||||
"reward.asset":"{{.GetVegaContractID "VEGA"}}",
|
||||
"reward.staking.delegation.competitionLevel":"3.1",
|
||||
"reward.staking.delegation.delegatorShare":"0.883",
|
||||
"reward.staking.delegation.maxPayoutPerEpoch":"7000000000000000000000",
|
||||
"reward.staking.delegation.maxPayoutPerParticipant":"700000000000000000000",
|
||||
"reward.staking.delegation.minValidators":"5",
|
||||
"reward.staking.delegation.minimumValidatorStake":"3000000000000000000000",
|
||||
"reward.staking.delegation.optimalStakeMultiplier":"3.0",
|
||||
"reward.staking.delegation.payoutDelay":"5m",
|
||||
"reward.staking.delegation.payoutFraction":"0.007",
|
||||
"rewards.marketCreationQuantumMultiple":"10000000",
|
||||
"snapshot.interval.length":"1000",
|
||||
"spam.pow.difficulty":"15",
|
||||
"spam.pow.hashFunction":"sha3_24_rounds",
|
||||
"spam.pow.increaseDifficulty":"0",
|
||||
"spam.pow.numberOfPastBlocks":"100",
|
||||
"spam.pow.numberOfTxPerBlock":"2",
|
||||
"spam.protection.delegation.min.tokens":"2000000000000000000",
|
||||
"spam.protection.max.batchSize":"15",
|
||||
"spam.protection.max.delegations":"390",
|
||||
"spam.protection.max.proposals":"100",
|
||||
"spam.protection.max.votes":"100",
|
||||
"spam.protection.maxUserTransfersPerEpoch":"20",
|
||||
"spam.protection.proposal.min.tokens":"1000000000000000000",
|
||||
"spam.protection.voting.min.tokens":"1000000000000000000",
|
||||
"transfer.fee.factor":"0.001",
|
||||
"transfer.minTransferQuantumMultiple":"0.1",
|
||||
"validators.delegation.minAmount":"100000000000000000",
|
||||
"validators.epoch.length":"5s",
|
||||
"validators.vote.required":"0.67"
|
||||
},
|
||||
"network_limits": {
|
||||
"propose_asset_enabled": true,
|
||||
|
Loading…
Reference in New Issue
Block a user