Merge branch 'develop' of github.com:vegaprotocol/frontend-monorepo into develop

This commit is contained in:
Madalina Raicu 2022-09-20 12:36:48 +01:00
commit 64ee6a5c75
No known key found for this signature in database
GPG Key ID: 688B7B31149C1DCD
120 changed files with 3932 additions and 2254 deletions

View File

@ -51,8 +51,7 @@
"ul": ["list"],
"ol": ["list"]
}
],
"curly": "warn"
]
}
},
{
@ -75,7 +74,8 @@
"prefer": "type-imports",
"disallowTypeAnnotations": true
}
]
],
"curly": ["error", "multi-line"]
}
},
{

45
.github/ISSUE_TEMPLATE/---bug.md vendored Normal file
View File

@ -0,0 +1,45 @@
---
name: "\U0001F41B Bug"
about: Create a report to help us improve
title: ''
labels: "\U0001F41B bug"
assignees: ''
---
## Description
A clear and concise description of what the bug is.
## Steps to Reproduce
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
## Expected behavior
A clear and concise description of what you expected to happen.
## Screenshots
If applicable, add screenshots to help explain your problem.
## Device details
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
## Additional context
Add any other context about the problem here.

21
.github/ISSUE_TEMPLATE/chore.md vendored Normal file
View File

@ -0,0 +1,21 @@
---
name: Chore
about:
A template to capture non feature / enhancement work we need to do like work
to support other functions or housekeeping etc.
title: ''
labels: chore
assignees: ''
---
## The Chore
What we need to achieve and who for
## Tasks
- [ ] What do we need to do first
- [ ] and then what?
- [ ] Etc.
## Additional details / background info

33
.github/ISSUE_TEMPLATE/user-story.md vendored Normal file
View File

@ -0,0 +1,33 @@
---
name: User Story
about:
A template to describe a features or enhancements we want to make from a users
perspective to ensure we understand what is needed and the value it would add
title: ''
labels: feature
assignees: ''
---
## Story
As a
I want
So that
## Acceptance Criteria
- [ ] I can
- [ ] I can
- [ ] I can
## Tasks
- [ ] Explore and sketch
- [ ] Team and stakeholder review
- [ ] Visual Design
- [ ] Team review
- [ ] Etc.
## Sketch
## Additional details / background info

View File

@ -140,6 +140,7 @@ jobs:
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPESS_ETH_WALLET_MNEMONIC }}
CYPRESS_INCLUDE_FLOWS: ${{ github.event.inputs.includeFlows }}
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
######
## Upload logs

View File

@ -125,6 +125,7 @@ jobs:
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPESS_ETH_WALLET_MNEMONIC }}
CYPRESS_NIGHTLY_RUN: true
CYPRESS_INCLUDE_FLOWS: true
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
######
## Upload logs

View File

@ -137,6 +137,7 @@ jobs:
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPESS_ETH_WALLET_MNEMONIC }}
CYPRESS_INCLUDE_FLOWS: false
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
######
## Upload logs

View File

@ -23,5 +23,4 @@ NX_DEPLOY_PRIME_URL=$DEPLOY_PRIME_URL
NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
NX_VEGA_ENV=TESTNET
NX_VEGA_REST=https://api.n11.testnet.vega.xyz
NX_VEGA_WALLET_URL=http://localhost:1789/api/v1

View File

@ -1,4 +1,3 @@
# App configuration variables
NX_VEGA_URL=http://localhost:3028/query
NX_VEGA_ENV=LOCAL
NX_VEGA_REST=http://localhost:3029

View File

@ -2,7 +2,6 @@
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/devnet-network.json
NX_VEGA_URL=https://api.n04.d.vega.xyz/graphql
NX_VEGA_ENV=DEVNET
NX_VEGA_REST=https://api.n04.d.vega.xyz
NX_VEGA_NETWORKS={\"MAINNET\":\"https://alpha.console.vega.xyz\"}
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io

View File

@ -1,8 +1,7 @@
# App configuration variables
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/mainnet-network.json
NX_VEGA_URL=https://api.token.vega.xyz/query
NX_VEGA_URL=https://api.vega.xyz/query
NX_VEGA_ENV=MAINNET
NX_VEGA_REST=https://api.token.vega.xyz
NX_VEGA_NETWORKS='{\"MAINNET\":\"https://alpha.console.vega.xyz\"}'
NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://etherscan.io

View File

@ -2,7 +2,6 @@
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json
NX_VEGA_URL=https://api.n01.stagnet3.vega.xyz/graphql
NX_VEGA_ENV=STAGNET3
NX_VEGA_REST=https://api.n01.stagnet3.vega.xyz
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_VEGA_EXPLORER_URL=https://staging2.explorer.vega.xyz

View File

@ -2,7 +2,6 @@
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/testnet-network.json
NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
NX_VEGA_ENV=TESTNET
NX_VEGA_REST=https://api.n11.testnet.vega.xyz
NX_VEGA_NETWORKS='{\"MAINNET\":\"https://alpha.console.vega.xyz\"}'
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io

View File

@ -3,7 +3,6 @@ NX_TENDERMINT_URL=http://localhost:26617
NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26617/websocket
NX_VEGA_URL=http://localhost:3028/query
NX_VEGA_ENV=CUSTOM
NX_VEGA_REST=http://localhost:3029
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/capsule-network.json
CYPRESS_VEGA_TENDERMINT_URL=http://localhost:26617

View File

@ -4,7 +4,6 @@ NX_TENDERMINT_URL=https://n04.d.vega.xyz/tm
NX_TENDERMINT_WEBSOCKET_URL=wss://n04.d.vega.xyz/tm/websocket
NX_VEGA_URL=https://api.n04.d.vega.xyz/graphql
NX_VEGA_ENV=DEVNET
NX_VEGA_REST=https://api.n04.d.vega.xyz
# App flags
NX_EXPLORER_ASSETS=1
@ -12,7 +11,7 @@ NX_EXPLORER_GENESIS=1
NX_EXPLORER_GOVERNANCE=1
NX_EXPLORER_MARKETS=1
NX_EXPLORER_ORACLES=1
NX_EXPLORER_TXS_LIST=1
NX_EXPLORER_TXS_LIST=0
NX_EXPLORER_NETWORK_PARAMETERS=1
NX_EXPLORER_PARTIES=1
NX_EXPLORER_VALIDATORS=1

View File

@ -2,9 +2,8 @@
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
NX_TENDERMINT_URL=https://mainnet-observer-proxy01.ops.vega.xyz/
NX_TENDERMINT_WEBSOCKET_URL=wss://mainnet-observer-proxy01.ops.vega.xyz/websocket
NX_VEGA_URL=https://api.token.vega.xyz/query
NX_VEGA_URL=https://api.vega.xyz/query
NX_VEGA_ENV=MAINNET
NX_VEGA_REST=https://api.token.vega.xyz/
# App flags
NX_EXPLORER_ASSETS=1

View File

@ -4,7 +4,6 @@ NX_TENDERMINT_URL=https://n01.stagnet3.vega.xyz/tm
NX_TENDERMINT_WEBSOCKET_URL=wss://n01.stagnet3.vega.xyz/tm/websocket
NX_VEGA_URL=https://api.n01.stagnet3.vega.xyz/graphql
NX_VEGA_ENV=STAGNET3
NX_VEGA_REST=https://api.n01.stagnet3.vega.xyz
# App flags
NX_EXPLORER_ASSETS=1
@ -12,7 +11,7 @@ NX_EXPLORER_GENESIS=1
NX_EXPLORER_GOVERNANCE=1
NX_EXPLORER_MARKETS=1
NX_EXPLORER_ORACLES=1
NX_EXPLORER_TXS_LIST=1
NX_EXPLORER_TXS_LIST=0
NX_EXPLORER_NETWORK_PARAMETERS=1
NX_EXPLORER_PARTIES=1
NX_EXPLORER_VALIDATORS=1

View File

@ -1,10 +1,9 @@
# App configuration variables
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
NX_TENDERMINT_URL=https://tm.n06.testnet.vega.xyz/tm
NX_TENDERMINT_URL=https://tm.n07.testnet.vega.xyz/tm
NX_TENDERMINT_WEBSOCKET_URL=wss://lb.testnet.vega.xyz/tm/websocket
NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
NX_VEGA_ENV=TESTNET
NX_VEGA_REST=https://api.n11.testnet.vega.xyz
# App flags
NX_EXPLORER_ASSETS=1
@ -12,7 +11,7 @@ NX_EXPLORER_GENESIS=1
NX_EXPLORER_GOVERNANCE=1
NX_EXPLORER_MARKETS=1
NX_EXPLORER_ORACLES=1
NX_EXPLORER_TXS_LIST=1
NX_EXPLORER_TXS_LIST=0
NX_EXPLORER_NETWORK_PARAMETERS=1
NX_EXPLORER_PARTIES=1
NX_EXPLORER_VALIDATORS=1

View File

@ -1,14 +1,7 @@
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
NX_TENDERMINT_URL=http://localhost:26617
NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26617/websocket
NX_VEGA_URL=http://localhost:3028/query
NX_VEGA_ENV=CUSTOM
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
NX_TENDERMINT_URL=https://n01.stagnet3.vega.xyz/tm
NX_TENDERMINT_WEBSOCKET_URL=wss://n01.stagnet3.vega.xyz/tm/websocket
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json
NX_VEGA_URL=https://api.n01.stagnet3.vega.xyz/graphql
NX_VEGA_NETWORKS='{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}'
NX_VEGA_ENV=STAGNET3
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
@ -22,4 +15,4 @@ NX_EXPLORER_PARTIES=1
NX_EXPLORER_VALIDATORS=1
NX_EXPLORER_MARKETS=1
NX_EXPLORER_ORACLES=1
NX_EXPLORER_TXS_LIST=1
NX_EXPLORER_TXS_LIST=0

View File

@ -13,7 +13,7 @@ NX_EXPLORER_GENESIS=1
NX_EXPLORER_GOVERNANCE=1
NX_EXPLORER_MARKETS=1
NX_EXPLORER_ORACLES=1
NX_EXPLORER_TXS_LIST=1
NX_EXPLORER_TXS_LIST=0
NX_EXPLORER_NETWORK_PARAMETERS=1
NX_EXPLORER_PARTIES=1
NX_EXPLORER_VALIDATORS=1

View File

@ -3,7 +3,7 @@ NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-exp
NX_TENDERMINT_URL=https://mainnet-observer-proxy01.ops.vega.xyz/
NX_TENDERMINT_WEBSOCKET_URL=wss://mainnet-observer-proxy01.ops.vega.xyz/websocket
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/mainnet-network.json
NX_VEGA_URL=https://api.token.vega.xyz/query
NX_VEGA_URL=https://api.vega.xyz/query
NX_VEGA_NETWORKS='{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}'
NX_VEGA_ENV=MAINNET
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions

View File

@ -1,9 +1,8 @@
# App configuration variables
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
NX_TENDERMINT_URL=https://tm.n06.testnet.vega.xyz
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n06.testnet.vega.xyz/websocket
NX_TENDERMINT_URL=https://tm.n07.testnet.vega.xyz
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n07.testnet.vega.xyz/websocket
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/testnet-network.json
NX_VEGA_URL=https://api.n09.testnet.vega.xyz/graphql
NX_VEGA_NETWORKS='{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}'
NX_VEGA_ENV=TESTNET
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions

View File

@ -17,7 +17,6 @@ const PendingTxs = () => {
<RouteTitle data-testid="unconfirmed-transactions-header">
{t('Unconfirmed transactions')}
</RouteTitle>
https://tm.n06.testnet.vega.xyz/tm/unconfirmed_txs
<br />
<div>{t(`Number: ${unconfirmedTransactions?.result?.n_txs || 0}`)}</div>
<br />

View File

@ -0,0 +1,10 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
}
]
}

View File

@ -0,0 +1,24 @@
const { defineConfig } = require('cypress');
module.exports = defineConfig({
projectId: 'et4snf',
e2e: {
baseUrl: 'http://localhost:4200',
fileServerFolder: '.',
fixturesFolder: false,
specPattern: './src/integration/*.ts',
excludeSpecPattern: '**/*.js',
modifyObstructiveCode: false,
supportFile: './src/support/index.ts',
video: true,
videoUploadOnPasses: false,
videosFolder:
'../../dist/cypress/apps/liquidity-provision-dashboard-e2e/videos',
screenshotsFolder:
'../../dist/cypress/apps/liquidity-provision-dashboard-e2e/screenshots',
chromeWebSecurity: false,
viewportWidth: 1440,
viewportHeight: 900,
},
});

View File

@ -0,0 +1,30 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/liquidity-provision-dashboard-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/liquidity-provision-dashboard-e2e/cypress.config.js",
"devServerTarget": "liquidity-provision-dashboard:serve"
},
"configurations": {
"production": {
"devServerTarget": "liquidity-provision-dashboard:serve:production"
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/liquidity-provision-dashboard-e2e/**/*.{js,ts}"
]
}
}
},
"tags": [],
"implicitDependencies": ["liquidity-provision-dashboard"]
}

View File

@ -0,0 +1,10 @@
import { getGreeting } from '../support/app.po';
describe('liquidity-provision-dashboard', () => {
beforeEach(() => cy.visit('/'));
it('should display welcome message', () => {
// Function helper example, see `../support/app.po.ts` file
getGreeting().contains('Top liquidity opportunities');
});
});

View File

@ -0,0 +1 @@
export const getGreeting = () => cy.get('h1');

View File

@ -0,0 +1,9 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************

View File

@ -0,0 +1,19 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
import '@vegaprotocol/cypress';
import 'cypress-real-events/support';
// Import commands.js using ES2015 syntax:
import './commands';

View File

@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"jsx": "react-jsx",
"sourceMap": false,
"allowSyntheticDefaultImports": true,
"outDir": "../../dist/out-tsc",
"allowJs": true,
"types": ["cypress", "node", "cypress-real-events"]
},
"include": ["src/**/*.ts", "src/**/*.js"]
}

View File

@ -0,0 +1,11 @@
{
"presets": [
[
"@nrwl/react/babel",
{
"runtime": "automatic"
}
]
],
"plugins": []
}

View File

@ -0,0 +1,16 @@
# This file is used by:
# 1. autoprefixer to adjust CSS to support the below specified browsers
# 2. babel preset-env to adjust included polyfills
#
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
#
# If you need to support different browsers in production, you may tweak the list below.
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major version
last 2 iOS major versions
Firefox ESR
not IE 9-11 # For IE 9-11 support, remove 'not'.

View File

@ -0,0 +1,27 @@
# React Environment Variables
# https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#expanding-environment-variables-in-env
# Netlify Environment Variables
# https://www.netlify.com/docs/continuous-deployment/#environment-variables
NX_VERSION=$npm_package_version
NX_REPOSITORY_URL=$REPOSITORY_URL
NX_BRANCH=$BRANCH
NX_PULL_REQUEST=$PULL_REQUEST
NX_HEAD=$HEAD
NX_COMMIT_REF=$COMMIT_REF
NX_CONTEXT=$CONTEXT
NX_REVIEW_ID=$REVIEW_ID
NX_INCOMING_HOOK_TITLE=$INCOMING_HOOK_TITLE
NX_INCOMING_HOOK_URL=$INCOMING_HOOK_URL
NX_INCOMING_HOOK_BODY=$INCOMING_HOOK_BODY
NX_URL=$URL
NX_DEPLOY_URL=$DEPLOY_URL
NX_DEPLOY_PRIME_URL=$DEPLOY_PRIME_URL
NX_VEGA_CONFIG_URL="https://static.vega.xyz/assets/testnet-network.json"
NX_VEGA_ENV = 'TESTNET'
NX_VEGA_URL="https://api.n11.testnet.vega.xyz/graphql"
NX_VEGA_WALLET_URL=http://localhost:1789/api/v1
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_VEGA_NETWORKS={"MAINNET":"https://alpha.console.vega.xyz"}
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf

View File

@ -0,0 +1,3 @@
# App configuration variables
NX_VEGA_URL=http://localhost:3028/query
NX_VEGA_ENV=LOCAL

View File

@ -0,0 +1,8 @@
# App configuration variables
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/devnet-network.json
NX_VEGA_URL=https://api.n04.d.vega.xyz/graphql
NX_VEGA_ENV=DEVNET
NX_VEGA_NETWORKS={\"MAINNET\":\"https://alpha.console.vega.xyz\"}
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_VEGA_EXPLORER_URL=https://dev.explorer.vega.xyz

View File

@ -0,0 +1,8 @@
# App configuration variables
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/mainnet-network.json
NX_VEGA_URL=https://api.vega.xyz/query
NX_VEGA_ENV=MAINNET
NX_VEGA_NETWORKS='{\"MAINNET\":\"https://alpha.console.vega.xyz\"}'
NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://etherscan.io
NX_VEGA_EXPLORER_URL=https://explorer.vega.xyz

View File

@ -0,0 +1,7 @@
# App configuration variables
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json
NX_VEGA_URL=https://api.n01.stagnet3.vega.xyz/graphql
NX_VEGA_ENV=STAGNET3
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_VEGA_EXPLORER_URL=https://staging2.explorer.vega.xyz

View File

@ -0,0 +1,8 @@
# App configuration variables
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/testnet-network.json
NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
NX_VEGA_ENV=TESTNET
NX_VEGA_NETWORKS='{\"MAINNET\":\"https://alpha.console.vega.xyz\"}'
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf

View File

@ -0,0 +1,18 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}

View File

@ -0,0 +1,11 @@
/* eslint-disable */
export default {
displayName: 'liquidity-provision-dashboard',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/next/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/liquidity-provision-dashboard',
};

View File

@ -0,0 +1,4 @@
[[redirects]]
from = "/*"
to = "/index.html"
status = 200

View File

@ -0,0 +1,10 @@
const { join } = require('path');
module.exports = {
plugins: {
tailwindcss: {
config: join(__dirname, 'tailwind.config.js'),
},
autoprefixer: {},
},
};

View File

@ -0,0 +1,93 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/liquidity-provision-dashboard/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/web:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"compiler": "babel",
"outputPath": "dist/apps/liquidity-provision-dashboard",
"index": "apps/liquidity-provision-dashboard/src/index.html",
"baseHref": "/",
"main": "apps/liquidity-provision-dashboard/src/main.tsx",
"polyfills": "apps/liquidity-provision-dashboard/src/polyfills.ts",
"tsConfig": "apps/liquidity-provision-dashboard/tsconfig.app.json",
"assets": [
"apps/liquidity-provision-dashboard/src/favicon.ico",
"apps/liquidity-provision-dashboard/src/assets"
],
"styles": ["apps/liquidity-provision-dashboard/src/styles.scss"],
"scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack"
},
"configurations": {
"development": {
"extractLicenses": false,
"optimization": false,
"sourceMap": true,
"vendorChunk": true
},
"production": {
"fileReplacements": [
{
"replace": "apps/liquidity-provision-dashboard/src/environments/environment.ts",
"with": "apps/liquidity-provision-dashboard/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false
}
}
},
"serve": {
"executor": "./tools/executors/webpack:serve",
"options": {
"buildTarget": "liquidity-provision-dashboard:build",
"hmr": true
},
"configurations": {
"development": {
"buildTarget": "liquidity-provision-dashboard:build:development"
},
"production": {
"buildTarget": "liquidity-provision-dashboard:build:production",
"hmr": false
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/liquidity-provision-dashboard/**/*.{ts,tsx,js,jsx}"
]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/liquidity-provision-dashboard"],
"options": {
"jestConfig": "apps/liquidity-provision-dashboard/jest.config.ts",
"passWithNoTests": true
}
},
"build-netlify": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"commands": [
"cp apps/liquidity-provision-dashboard/netlify.toml netlify.toml",
"nx build liquidity-provision-dashboard"
]
}
}
},
"tags": []
}

View File

@ -0,0 +1,11 @@
import '../styles.scss';
export function App() {
return (
<div className="flex items-stretch px-6 py-6">
<h1 className="text-3xl">Top liquidity opportunities</h1>
</div>
);
}
export default App;

View File

@ -0,0 +1,3 @@
export const environment = {
production: true,
};

View File

@ -0,0 +1,6 @@
// This file can be replaced during build by using the `fileReplacements` array.
// When building for production, this file is replaced with `environment.prod.ts`.
export const environment = {
production: false,
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Liquidity Provision Dashboard</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link
rel="preload"
href="https://static.vega.xyz/AlphaLyrae-Medium.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="https://static.vega.xyz/fonts.css" />
</head>
<body>
<div id="root" class="h-full max-h-full"></div>
</body>
</html>

View File

@ -0,0 +1,13 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import App from './app/app';
const rootElement = document.getElementById('root');
const root = rootElement && createRoot(rootElement);
root?.render(
<StrictMode>
<App />
</StrictMode>
);

View File

@ -0,0 +1,7 @@
/**
* Polyfill stable language features. These imports will be optimized by `@babel/preset-env`.
*
* See: https://github.com/zloirock/core-js#babel
*/
import 'core-js/stable';
import 'regenerator-runtime/runtime';

View File

@ -0,0 +1,8 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
html,
body {
@apply h-full;
}

View File

@ -0,0 +1,16 @@
const { join } = require('path');
const { createGlobPatternsForDependencies } = require('@nrwl/next/tailwind');
const theme = require('../../libs/tailwindcss-config/src/theme-lite');
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');
const vegaCustomClassesLite = require('../../libs/tailwindcss-config/src/vega-custom-classes-lite');
module.exports = {
content: [
join(__dirname, 'src/**/*.{js,ts,jsx,tsx}'),
'libs/ui-toolkit/src/utils/shared.ts',
...createGlobPatternsForDependencies(__dirname),
],
darkMode: 'class',
theme,
plugins: [vegaCustomClasses, vegaCustomClassesLite],
};

View File

@ -0,0 +1,23 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
},
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.test.tsx",
"**/*.spec.js",
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
}

View File

@ -0,0 +1,25 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"jsx": "react-jsx",
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}

View File

@ -0,0 +1,27 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node", "@testing-library/jest-dom"],
"jsx": "react",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
},
"include": [
"jest.config.ts",
"**/*.test.ts",
"**/*.spec.ts",
"**/*.test.tsx",
"**/*.spec.tsx",
"**/*.test.js",
"**/*.spec.js",
"**/*.test.jsx",
"**/*.spec.jsx",
"**/*.d.ts"
],
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
]
}

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,11 @@
{
"hosts": ["https://api.n09.testnet.vega.xyz/graphql"]
"hosts": [
"https://api.n06.testnet.vega.xyz/graphql",
"https://api.n07.testnet.vega.xyz/graphql",
"https://api.n08.testnet.vega.xyz/graphql",
"https://api.n09.testnet.vega.xyz/graphql",
"https://api.n10.testnet.vega.xyz/graphql",
"https://api.n11.testnet.vega.xyz/graphql",
"https://api.n12.testnet.vega.xyz/graphql"
]
}

View File

@ -89,7 +89,7 @@
"tranche_end": "2022-10-12T00:53:20.000Z",
"total_added": "1010.000000000000000001",
"total_removed": "668.4622323651",
"locked_amount": "76.84230910705220220007608149416539822",
"locked_amount": "60.24085045662102080005964440639269408",
"deposits": [
{
"amount": "1000",

View File

@ -1,4 +1,3 @@
# App configuration variables
NX_VEGA_ENV=TESTNET
CYPRESS_VEGA_ENV=TESTNET
NX_VEGA_REST=https://api.n10.testnet.vega.xyz

View File

@ -1,4 +1,3 @@
# App configuration variables
NX_VEGA_ENV=DEVNET
CYPRESS_VEGA_ENV=DEVNET
NX_VEGA_REST=https://api.n04.d.vega.xyz

View File

@ -1,4 +1,3 @@
# App configuration variables
NX_VEGA_ENV=MAINNET
CYPRESS_VEGA_ENV=MAINNET
NX_VEGA_REST=https://api.token.vega.xyz/

View File

@ -1,4 +1,3 @@
# App configuration variables
NX_VEGA_ENV=STAGNET3
CYPRESS_VEGA_ENV=STAGNET3
NX_VEGA_REST=https://api.n01.stagnet3.vega.xyz

View File

@ -1,4 +1,3 @@
# App configuration variables
NX_VEGA_ENV=TESTNET
CYPRESS_VEGA_ENV=TESTNET
NX_VEGA_REST=https://api.n11.testnet.vega.xyz

View File

@ -1,3 +1,3 @@
# App configuration variables
NX_VEGA_ENV=MAINNET
NX_VEGA_URL=https://api.token.vega.xyz/query
NX_VEGA_URL=https://api.vega.xyz/query

View File

@ -1,3 +1,3 @@
# App configuration variables. No overrides for default urls
NX_VEGA_ENV=MAINNET
NX_VEGA_URL=https://api.token.vega.xyz/query
NX_VEGA_URL=https://api.vega.xyz/query

View File

@ -6,7 +6,6 @@ NX_FAIRGROUND=false
NX_VEGA_NETWORKS={}
NX_VEGA_URL=http://localhost:3028/query
NX_VEGA_REST=http://localhost:3029
NX_ETHEREUM_CHAIN_ID=1440
NX_ETH_URL_CONNECT=1
NX_ETH_WALLET_MNEMONIC=ozone access unlock valid olympic save include omit supply green clown session

View File

@ -1,5 +1,5 @@
# App configuration variables
NX_VEGA_ENV=MAINNET
NX_VEGA_URL=https://api.token.vega.xyz/query
NX_VEGA_URL=https://api.vega.xyz/query
NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://etherscan.io

View File

@ -42,7 +42,8 @@ module.exports = defineConfig({
vegaTokenContractAddress: '0xF41bD86d462D36b997C0bbb4D97a0a3382f205B7',
vegaTokenAddress: '0x67175Da1D5e966e40D11c4B2519392B2058373de',
txTimeout: { timeout: 70000 },
epochTimeout: { timeout: 11000 },
epochTimeout: { timeout: 6000 },
blockConfirmations: 3,
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true,
},
});

View File

@ -4,6 +4,12 @@ const vegaWalletUnstakedBalance =
'[data-testid="vega-wallet-balance-unstaked"]';
const vegaWalletStakedBalances =
'[data-testid="vega-wallet-balance-staked-validators"]';
const vegaWalletAssociatedBalance = '[data-testid="currency-value"]';
const vegaWalletNameElement = '[data-testid="wallet-name"]';
const vegaWallet = '[data-testid="vega-wallet"]';
const vegaWalletName = Cypress.env('vegaWalletName');
const vegaWalletPassphrase = Cypress.env('vegaWalletPassphrase');
const connectToVegaWalletButton = '[data-testid="connect-to-vega-wallet-btn"]';
const newProposalButton = '[data-testid="new-proposal-link"]';
const newProposalDatabox = '[data-testid="proposal-data"]';
const newProposalSubmitButton = '[data-testid="proposal-submit"]';
@ -11,7 +17,6 @@ const dialogCloseButton = '[data-testid="dialog-close"]';
const viewProposalButton = '[data-testid="view-proposal-btn"]';
const proposalInformationTableRows = '[data-testid="key-value-table-row"]';
const openProposals = '[data-testid="open-proposals"]';
const vegaWalletAssociatedBalance = '[data-testid="currency-value"]';
const proposalResponseProposalIdPath =
'response.body.data.busEvents.0.event.id';
const proposalVoteProgressForPercentage =
@ -26,10 +31,13 @@ const changeVoteButton = '[data-testid="change-vote-button"]';
const proposalDetailsTitle = '[data-testid="proposal-title"]';
const proposalDetailsDescription = '[data-testid="proposal-description"]';
const voteButtons = '[data-testid="vote-buttons"]';
const voteStatus = '[data-testid="vote-status"]';
const rejectProposalsLink = '[href="/governance/rejected"]';
const feedbackError = '[data-testid="Error"]';
const txTimeout = Cypress.env('txTimeout');
const epochTimeout = Cypress.env('epochTimeout');
const proposalTimeout = { timeout: 14000 };
const restConnectorForm = '[data-testid="rest-connector-form"]';
context('Governance flow - with eth and vega wallets connected', function () {
before('connect wallets and set approval limit', function () {
@ -103,8 +111,8 @@ context('Governance flow - with eth and vega wallets connected', function () {
}
);
beforeEach('visit staking tab', function () {
cy.navigate_to('staking');
beforeEach('visit governance tab', function () {
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.intercept('POST', '/query', (req) => {
if (req.body.operationName === 'ProposalEvent') {
@ -113,12 +121,18 @@ context('Governance flow - with eth and vega wallets connected', function () {
});
});
it('Submit a proposal form - shows how many vega tokens are required to make a proposal', function () {
cy.get(newProposalButton).should('be.visible').click();
cy.contains(
`You must have at least ${this.minProposerBalance} VEGA associated to make a proposal`
).should('be.visible');
});
it('Able to submit a valid freeform proposal - with minimum required tokens associated', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('7').then(
(closingDateTimestamp) => {
@ -132,7 +146,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
});
@ -140,6 +154,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(vegaWalletUnstakedBalance, txTimeout).should(
'contain',
this.minProposerBalance,
@ -168,7 +183,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
});
@ -176,8 +191,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('7').then(
(closingDateTimestamp) => {
@ -188,7 +202,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -206,8 +220,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('7').then(
(closingDateTimestamp) => {
@ -218,7 +231,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -236,8 +249,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('8').then(
(closingDateTimestamp) => {
@ -250,7 +262,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -282,8 +294,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('8').then(
(closingDateTimestamp) => {
@ -294,7 +305,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -312,12 +323,110 @@ context('Governance flow - with eth and vega wallets connected', function () {
});
});
it('Newly created freeform proposal details - shows proposal title and full description', function () {
it('Newly created freeform proposals list - proposals closest to closing date appear higher in list', function () {
// 1004-VOTE-005
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
// Ensuring that proposals are not posted in same order as sort order
let proposalDays = [
this.minCloseDays + 1,
this.maxCloseDays,
this.minCloseDays + 3,
this.minCloseDays + 2,
];
for (var index = 0; index < proposalDays.length; index++) {
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days(
proposalDays[index]
).then((closingDateTimestamp) => {
cy.enter_unique_freeform_proposal_body(closingDateTimestamp);
});
cy.get(newProposalSubmitButton).should('be.visible').click();
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
}
let arrayOfProposals = [];
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.get(proposalDetailsTitle)
.each((proposalTitleElement) => {
arrayOfProposals.push(proposalTitleElement.text());
})
.then(() => {
cy.get_sort_order_of_supplied_array(arrayOfProposals).should(
'equal',
'descending'
);
});
});
// Skipping test due to bug: #1320
it.skip('Newly created freeform proposals list - shows proposal parcipitation - both met and not', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('7').then(
(closingDateTimestamp) => {
cy.enter_unique_freeform_proposal_body(closingDateTimestamp);
}
);
cy.get(newProposalSubmitButton).should('be.visible').click();
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.get_submitted_proposal_from_proposal_list()
.as('submittedProposal')
.within(() => {
// 1004-VOTE-039
cy.get(voteStatus).should('have.text', 'Participation not reached');
cy.get(viewProposalButton).click();
});
cy.vote_for_proposal('for');
cy.get_proposal_information_from_table('Total Supply')
.invoke('text')
.then((totalSupply) => {
let tokensRequiredToAcheiveResult = parseFloat(
(totalSupply.replace(/,/g, '') * this.requiredParticipation) / 100
).toFixed(2);
cy.ensure_specified_unstaked_tokens_are_associated(
tokensRequiredToAcheiveResult
);
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get('@submittedProposal').within(() =>
cy.get(viewProposalButton).click()
);
cy.get_proposal_information_from_table('Participation met')
.contains('👍')
.should('be.visible');
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.get('@submittedProposal').within(() =>
cy.get(voteStatus).should('have.text', 'Participation met')
);
});
});
// Skipping test due to bug - should be solved when #1223 released
it.skip('Newly created freeform proposal details - shows proposal title and full description', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('8').then(
(closingDateTimestamp) => {
@ -330,7 +439,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -355,12 +464,12 @@ context('Governance flow - with eth and vega wallets connected', function () {
});
});
it('Newly created freeform proposal details - shows full link included in description', function () {
// Skipping test due to bug - should be solved when #1223 released
it.skip('Newly created freeform proposal details - shows full link included in description', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('8').then(
(closingDateTimestamp) => {
@ -373,7 +482,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -386,11 +495,10 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.get(viewProposalButton).should('be.visible').click();
});
});
cy.get('@freeformProposal').then((freeformProposal) => {
cy.get('@freeformProposal').then(() => {
// 1004-VOTE-055
cy.get(proposalDetailsDescription)
.should('contain', freeformProposal.rationale.description)
.and('have.attr', 'href')
.should('have.attr', 'href')
.and(
'equal',
'https://dweb.link/ipfs/bafybeigwwctpv37xdcwacqxvekr6e4kaemqsrv34em6glkbiceo3fcy4si'
@ -404,8 +512,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('8').then(
(closingDateTimestamp) => {
@ -416,7 +523,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -445,8 +552,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('9').then(
(closingDateTimestamp) => {
@ -456,7 +562,9 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should(
'be.visible'
);
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -486,13 +594,11 @@ context('Governance flow - with eth and vega wallets connected', function () {
it('Newly created freeform proposal details - shows default status set to fail', function () {
// 1004-VOTE-037
// 1004-VOTE-039
// 1004-VOTE-040
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('7').then(
(closingDateTimestamp) => {
@ -503,7 +609,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -519,6 +625,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
.contains('👎')
.should('be.visible');
// 1004-VOTE-062
// 1004-VOTE-040
cy.get_proposal_information_from_table('Majority met')
.contains('👎')
.should('be.visible');
@ -531,8 +638,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('7').then(
(closingDateTimestamp) => {
@ -543,7 +649,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -551,6 +657,9 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.get_submitted_proposal_from_proposal_list()
.as('submittedProposal')
.within(() => cy.get(viewProposalButton).click());
// 1004-VOTE-080
cy.get(voteButtons).contains('against').should('be.visible');
cy.get(voteButtons).contains('for').should('be.visible');
cy.vote_for_proposal('for');
cy.get_governance_proposal_date_format_for_specified_days(
'0',
@ -598,8 +707,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('7').then(
(closingDateTimestamp) => {
@ -610,7 +718,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -662,8 +770,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('7').then(
(closingDateTimestamp) => {
@ -674,7 +781,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -719,8 +826,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('7').then(
(closingDateTimestamp) => {
@ -731,7 +837,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -742,7 +848,6 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.vote_for_proposal('for');
cy.get(changeVoteButton).should('be.visible').click();
cy.wait_for_spinner();
// 1004-VOTE-080
cy.vote_for_proposal('against');
cy.get(proposalVoteProgressForPercentage)
.contains('0.00%')
@ -775,8 +880,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('7').then(
(closingDateTimestamp) => {
@ -787,7 +891,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', epochTimeout).should('be.visible');
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -795,8 +899,9 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.get_submitted_proposal_from_proposal_list()
.as('submittedProposal')
.within(() => cy.get(viewProposalButton).click());
// 1004-VOTE-080
cy.vote_for_proposal('for');
// 1004-VOTE-079
cy.contains('You voted: For').should('be.visible');
cy.get_proposal_information_from_table('Total Supply')
.invoke('text')
.then((totalSupply) => {
@ -806,8 +911,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
tokensRequiredToAcheiveResult
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get('@submittedProposal').within(() =>
cy.get(viewProposalButton).click()
);
@ -818,7 +922,6 @@ context('Governance flow - with eth and vega wallets connected', function () {
.contains('0.00%')
.and('be.visible');
// 1004-VOTE-065
// 1004-VOTE-079
cy.get(proposalVoteProgressForTokens)
.contains(tokensRequiredToAcheiveResult)
.and('be.visible');
@ -857,8 +960,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days(
this.minCloseDays - 1
@ -869,7 +971,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal rejected', epochTimeout).should('be.visible');
cy.contains('Proposal rejected', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -885,8 +987,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days(
this.maxCloseDays + 1
@ -897,7 +998,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal rejected', epochTimeout).should('be.visible');
cy.contains('Proposal rejected', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -913,8 +1014,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days(
this.maxCloseDays + 1
@ -925,7 +1025,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal rejected', epochTimeout).should('be.visible');
cy.contains('Proposal rejected', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
@ -953,8 +1053,6 @@ context('Governance flow - with eth and vega wallets connected', function () {
'0.000000000000000000',
txTimeout
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('1').then(
(closingDateTimestamp) => {
@ -963,7 +1061,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
);
cy.get(newProposalSubmitButton).should('be.visible').click();
cy.contains('Transaction failed', epochTimeout).should('be.visible');
cy.contains('Transaction failed', proposalTimeout).should('be.visible');
cy.get(feedbackError)
.contains(
'Party has insufficient associated governance tokens in their staking account to submit proposal request'
@ -975,8 +1073,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance - 0.000001
);
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('1').then(
(closingDateTimestamp) => {
@ -985,7 +1082,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
);
cy.get(newProposalSubmitButton).should('be.visible').click();
cy.contains('Transaction failed', epochTimeout).should('be.visible');
cy.contains('Transaction failed', proposalTimeout).should('be.visible');
cy.get(feedbackError)
.contains(
'Party has insufficient associated governance tokens in their staking account to submit proposal request'
@ -993,6 +1090,158 @@ context('Governance flow - with eth and vega wallets connected', function () {
.should('be.visible');
});
it('Unable to create a freeform proposal - when json parent section contains unexpected field', function () {
// 1004-VOTE-038
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('1').then(
(closingDateTimestamp) => {
cy.fixture('/proposals/freeform.json').then((freeformProposal) => {
freeformProposal.terms.closingTimestamp = closingDateTimestamp;
freeformProposal.unexpectfield = `i shouldn't be here`;
let proposalPayload = JSON.stringify(freeformProposal);
cy.get(newProposalDatabox).type(proposalPayload, {
parseSpecialCharSequences: false,
delay: 2,
});
});
}
);
cy.get(newProposalSubmitButton).should('be.visible').click();
cy.contains('Transaction failed', proposalTimeout).should('be.visible');
cy.get(feedbackError)
.contains('Unknown field unexpectfield in vega commands')
.should('be.visible');
});
it('Unable to create a freeform proposal - when json terms section contains unexpected field', function () {
// 1004-VOTE-038
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('1').then(
(closingDateTimestamp) => {
cy.fixture('/proposals/freeform.json').then((freeformProposal) => {
freeformProposal.terms.closingTimestamp = closingDateTimestamp;
freeformProposal.terms.unexpectfield = `i shouldn't be here`;
let proposalPayload = JSON.stringify(freeformProposal);
cy.get(newProposalDatabox).type(proposalPayload, {
parseSpecialCharSequences: false,
delay: 2,
});
});
}
);
cy.get(newProposalSubmitButton).should('be.visible').click();
cy.contains('Transaction failed', proposalTimeout).should('be.visible');
cy.get(feedbackError)
.contains('Unknown field unexpectfield in vega proposal terms')
.should('be.visible');
});
// Have to skip because #1326 bug doesn't handle below scenario
it.skip('Unable to vote on a freeform proposal - when some but not enough vega associated', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('7').then(
(closingDateTimestamp) => {
cy.enter_unique_freeform_proposal_body(closingDateTimestamp);
}
);
cy.get(newProposalSubmitButton).should('be.visible').click();
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.staking_page_disassociate_tokens('0.0001');
cy.get(vegaWallet).within(() => {
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
'contain',
'0.999900000000000000'
);
});
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.get_submitted_proposal_from_proposal_list()
.as('submittedProposal')
.within(() => cy.get(viewProposalButton).click());
cy.contains('Vote breakdown').should('be.visible', { timeout: 10000 });
cy.get(voteButtons).contains('for').should('not.exist');
cy.get(voteButtons).contains('against').should('not.exist');
});
it('Unable to vote on a freeform proposal - when vega wallet disconnected - option to connect from within', function () {
cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance
);
cy.navigate_to_page_if_not_allready_loaded('governance');
cy.get(newProposalButton).should('be.visible').click();
cy.create_ten_digit_unix_timestamp_for_specified_days('7').then(
(closingDateTimestamp) => {
cy.enter_unique_freeform_proposal_body(closingDateTimestamp);
}
);
cy.get(newProposalSubmitButton).should('be.visible').click();
cy.contains('Awaiting network confirmation', epochTimeout).should(
'be.visible'
);
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
cy.get(dialogCloseButton).click();
cy.wait_for_proposal_sync();
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.get('[data-testid="manage-vega-wallet"]').click();
cy.get('[data-testid="disconnect"]').click();
cy.get_submitted_proposal_from_proposal_list()
.as('submittedProposal')
.within(() => cy.get(viewProposalButton).click());
// 1004-VOTE-075
// 1004-VOTE-076
cy.get(connectToVegaWalletButton)
.should('be.visible')
.and('have.text', 'Connect Vega wallet')
.click();
cy.contains('rest provider').click();
cy.get(restConnectorForm).within(() => {
cy.get('#wallet').click().type(vegaWalletName);
cy.get('#passphrase').click().type(vegaWalletPassphrase);
cy.get('button').contains('Connect').click();
});
cy.get(vegaWalletNameElement).should('be.visible');
cy.get(connectToVegaWalletButton).should('not.exist');
// 1004-VOTE-100
cy.get(vegaWalletAssociatedBalance, txTimeout).contains(
'1.000000000000000000',
txTimeout
);
cy.vote_for_proposal('against');
// 1004-VOTE-079
cy.contains('You voted: Against').should('be.visible');
});
after(
'teardown environment to prevent test data bleeding into other tests',
function () {
if (Cypress.env('CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS')) {
cy.restartVegacapsuleNetwork();
}
}
);
Cypress.Commands.add(
'convert_unix_timestamp_to_governance_data_table_date_format',
(unixTimestamp, monthTextLength = 'longMonth') => {
@ -1101,15 +1350,6 @@ context('Governance flow - with eth and vega wallets connected', function () {
cy.get(voteButtons).contains(vote).click();
cy.contains('Casting vote...').should('be.visible');
cy.contains('Casting vote...', txTimeout).should('not.exist');
// below section temporary until #1090 fixed Casting vote in vegacapsule always says:
// Something went wrong, and your vote was not seen by the network - despite vote success
cy.navigate_to('governance');
cy.wait_for_spinner();
cy.get('@submittedProposal').within(() =>
cy.get(viewProposalButton).click()
);
cy.wait_for_spinner();
});
Cypress.Commands.add('wait_for_proposal_sync', () => {
@ -1137,5 +1377,32 @@ context('Governance flow - with eth and vega wallets connected', function () {
}
});
});
Cypress.Commands.add(
'navigate_to_page_if_not_allready_loaded',
(section) => {
cy.url().then((url) => {
if (url != `http://localhost:4210/${section}`) {
cy.navigate_to(section);
cy.wait_for_spinner();
}
});
}
);
Cypress.Commands.add(
'get_sort_order_of_supplied_array',
(suppliedArray) => {
const tempArray = [];
for (let index = 1; index < suppliedArray.length; index++) {
tempArray.push(
suppliedArray[index - 1].localeCompare(suppliedArray[index])
);
}
if (tempArray.every((n) => n <= 0)) return 'ascending';
else if (tempArray.every((n) => n >= 0)) return 'descending';
else return 'unsorted';
}
);
});
});

View File

@ -17,10 +17,6 @@ const vegaWalletUnstakedBalance =
'[data-testid="vega-wallet-balance-unstaked"]';
const vegaWalletStakedBalances =
'[data-testid="vega-wallet-balance-staked-validators"]';
const vegaWalletThisEpochBalances =
'[data-testid="vega-wallet-balance-this-epoch"]';
const vegaWalletNextEpochBalances =
'[data-testid="vega-wallet-balance-next-epoch"]';
const ethWalletAssociatedBalances =
'[data-testid="eth-wallet-associated-balances"]';
const ethWalletTotalAssociatedBalance = '[data-testid="currency-locked"]';
@ -81,12 +77,6 @@ context('Staking Tab - with eth and vega wallets connected', function () {
// 1002-STKE-033, 1002-STKE-034, 1002-STKE-037
cy.staking_validator_page_add_stake('2');
// 1002-STKE-038
cy.get(vegaWalletNextEpochBalances, txTimeout)
.should('contain', 2.0, txTimeout)
.and('contain', partValidatorId)
.and('contain', 'Next epoch');
cy.get(vegaWalletUnstakedBalance, txTimeout).should(
'contain',
1.0,
@ -331,17 +321,6 @@ context('Staking Tab - with eth and vega wallets connected', function () {
// 1002-STKE-049
cy.get(stakeNextEpochValue, epochTimeout).contains(2.0, epochTimeout);
cy.get(vegaWalletNextEpochBalances, txTimeout).should(
'contain',
2.0,
txTimeout
);
cy.get(vegaWalletThisEpochBalances, txTimeout)
.should('contain', 3.0, txTimeout)
.and('contain', partValidatorId)
.and('contain', 'This Epoch');
cy.get(vegaWalletUnstakedBalance, txTimeout).should(
'contain',
2.0,
@ -401,12 +380,6 @@ context('Staking Tab - with eth and vega wallets connected', function () {
.contains(0.0, epochTimeout)
.should('be.visible');
cy.get(vegaWalletThisEpochBalances, txTimeout).should(
'contain',
1.0,
txTimeout
);
cy.get(vegaWalletUnstakedBalance, txTimeout).should(
'contain',
3.0,
@ -865,9 +838,11 @@ context('Staking Tab - with eth and vega wallets connected', function () {
});
after(
'teardown wallet so state/results dont bleed into other test suites',
'teardown environment to prevent test data bleeding into other tests',
function () {
cy.vega_wallet_teardown();
if (Cypress.env('CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS')) {
cy.restartVegacapsuleNetwork();
}
}
);
});

View File

@ -33,7 +33,6 @@ context(
cy.ethereum_wallet_connect();
cy.navigate_to('staking');
cy.wait_for_spinner();
cy.wait_for_begining_of_epoch();
});
describe('Eth wallet - contains VEGA tokens', function () {
@ -276,6 +275,15 @@ context(
cy.get(tokenAmountInputBox, { timeout: 10000 }).type(6500000);
cy.get(tokenSubmitButton, txTimeout).should('be.disabled');
});
after(
'teardown environment to prevent test data bleeding into other tests',
function () {
if (Cypress.env('CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS')) {
cy.restartVegacapsuleNetwork();
}
}
);
});
}
);

View File

@ -1,7 +1,10 @@
const noOpenProposals = '[data-testid="no-open-proposals"]';
const noClosedProposals = '[data-testid="no-closed-proposals"]';
const proposalDocumentationLink = '[data-testid="external-link"]';
const newProposalButton = '[data-testid="new-proposal-link"]';
const newProposalLink = '[data-testid="new-proposal-link"]';
const governanceDocsUrl = 'https://vega.xyz/governance';
const connectToVegaWalletButton = '[data-testid="connect-to-vega-wallet-btn"]';
context('Governance Page - verify elements on page', function () {
before('navigate to governance page', function () {
@ -17,13 +20,25 @@ context('Governance Page - verify elements on page', function () {
cy.verify_page_header('Governance');
});
it('should be able to see link for - Find out more about Vega governance', function () {
it('should be able to see a working link for - find out more about Vega governance', function () {
// 1004-VOTE-001
cy.get(proposalDocumentationLink)
.should('be.visible')
.and('have.text', 'Find out more about Vega governance')
.and('have.attr', 'href')
.and('equal', 'https://vega.xyz/governance');
.and('equal', governanceDocsUrl);
cy.request(governanceDocsUrl)
.its('body')
.then((body) => {
if (!body.includes('Govern the network')) {
assert.include(
body,
'Govern the network',
`Checking that governance link destination includes 'Govern the network' text`
);
}
});
});
it('should be able to see button for - new proposal', function () {
@ -44,5 +59,14 @@ context('Governance Page - verify elements on page', function () {
.should('be.visible')
.and('have.text', 'There are no enacted or rejected proposals');
});
it('should be able to see a connect wallet button - if vega wallet disconnected and new proposal button selected', function () {
cy.get(newProposalButton).should('be.visible').click();
cy.get(connectToVegaWalletButton)
.should('be.visible')
.and('have.text', 'Connect Vega wallet');
cy.navigate_to('governance');
cy.wait_for_spinner();
});
});
});

View File

@ -181,7 +181,11 @@ context('Ethereum Wallet - verify elements on widget', function () {
.as('unlocked');
})
.then(function () {
expect(this.value).to.equal(this.locked + this.unlocked);
expect(parseFloat(this.value).toFixed(1)).to.equal(
parseFloat(
Math.round((this.locked + this.unlocked) * 100) / 100
).toFixed(1)
);
});
});
});

View File

@ -9,7 +9,6 @@ const dialogHeader = '[data-testid="dialog-title"]';
const connectorsList = '[data-testid="connectors-list"]';
const dialogCloseBtn = '[data-testid="dialog-close"]';
const restConnectorForm = '[data-testid="rest-connector-form"]';
const restUrl = '#url';
const restWallet = '#wallet';
const restPassphrase = '#passphrase';
const restConnectBtn = '[type="submit"]';
@ -96,14 +95,6 @@ context('Vega Wallet - verify elements on widget', function () {
});
});
it('should have url field visible', function () {
cy.get(restConnectorForm).within(() => {
cy.get(restUrl)
.should('be.visible')
.and('have.value', 'http://localhost:1789/api/v1');
});
});
it('should have wallet field visible', function () {
cy.get(restConnectorForm).within(() => {
cy.get(restWallet).should('be.visible');

View File

@ -36,3 +36,36 @@ Cypress.Commands.add('verify_page_header', (text) => {
Cypress.Commands.add('wait_for_spinner', () => {
cy.get(navigation.pageSpinner, { timeout: 20000 }).should('not.exist');
});
Cypress.Commands.add('restartVegacapsuleNetwork', () => {
Cypress.on('uncaught:exception', () => {
// stopping the network causes errors with pending transactions
// This stops those errors from preventing the teardown
return false;
});
// We stop the network twice - since it does not always shutdown correctly on first attempt
cy.exec('vegacapsule network destroy', { failOnNonZeroExit: false });
cy.exec('vegacapsule network destroy', { failOnNonZeroExit: false })
.its('stderr')
.should('contain', 'network cleaning up success');
cy.exec(
'vegacapsule network bootstrap --config-path=../../vegacapsule/config.hcl --force',
{ failOnNonZeroExit: false, timeout: 100000 }
)
.its('stderr')
.then((response) => {
if (!response.includes('starting network success')) {
cy.exec('vegacapsule network destroy', { failOnNonZeroExit: false });
cy.exec(
'vegacapsule network bootstrap --config-path=../../vegacapsule/config.hcl --force',
{ failOnNonZeroExit: false, timeout: 100000 }
)
.its('stderr')
.then((response) => {
return response;
});
}
})
.should('contain', 'starting network success');
});

View File

@ -15,4 +15,8 @@ Cypress.Commands.add('ethereum_wallet_connect', () => {
// this check is required since it ensures the wallet is fully (not partially) loaded
cy.contains('Locked', { timeout: 15000 }).should('be.visible');
});
// Even once eth wallet connected - attempting a transaction will fail
// It needs a few seconds before becoming operational
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(4000);
});

View File

@ -32,7 +32,7 @@ Cypress.Commands.add('vega_wallet_connect', () => {
.and('be.visible')
.click({ force: true });
});
cy.get('button').contains('rest provider').click();
cy.contains('rest provider').click();
cy.get(restConnectorForm).within(() => {
cy.get('#wallet').click().type(vegaWalletName);
cy.get('#passphrase').click().type(vegaWalletPassphrase);

View File

@ -4,7 +4,6 @@ NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/testnet-network.json
NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_VEGA_REST=https://api.n07.testnet.vega.xyz
NX_FAIRGROUND=false
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://stagnet3.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}'
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions

View File

@ -8,7 +8,6 @@ NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
NX_VEGA_CONFIG_URL=''
NX_VEGA_URL=http://localhost:3028/query
NX_VEGA_REST=http://localhost:3029
NX_ETHEREUM_CHAIN_ID=1440
NX_ETH_URL_CONNECT=1
NX_ETH_WALLET_MNEMONIC=ozone access unlock valid olympic save include omit supply green clown session

View File

@ -2,7 +2,6 @@
NX_VEGA_ENV=DEVNET
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/devnet-network.json
NX_VEGA_URL=https://api.n04.d.vega.xyz/graphql
NX_VEGA_REST=https://api.n04.d.vega.xyz
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://stagnet3.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}'
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io

View File

@ -1,10 +1,9 @@
# App configuration variables
NX_VEGA_ENV=MAINNET
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/mainnet-network.json
NX_VEGA_URL=https://api.token.vega.xyz/query
NX_VEGA_URL=https://api.vega.xyz/query
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://stagnet3.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}'
NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://etherscan.io
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
NX_VEGA_REST=https://api.token.vega.xyz/
NX_VEGA_EXPLORER_URL=https://explorer.vega.xyz

View File

@ -4,7 +4,6 @@ NX_TENDERMINT_URL=https://tm.n01.stagnet3.vega.xyz/
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n01.stagnet3.vega.xyz/websocket
NX_VEGA_URL=https://api.n01.stagnet3.vega.xyz/graphql
NX_VEGA_ENV=STAGNET3
NX_VEGA_REST=https://api.n01.stagnet3.vega.xyz
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://stagnet3.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}'
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json
NX_VEGA_EXPLORER_URL=https://staging3.explorer.vega.xyz
@ -18,4 +17,4 @@ NX_EXPLORER_PARTIES=1
NX_EXPLORER_VALIDATORS=1
NX_EXPLORER_MARKETS=1
NX_EXPLORER_ORACLES=1
NX_EXPLORER_TXS_LIST=1
NX_EXPLORER_TXS_LIST=0

View File

@ -6,5 +6,4 @@ NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://sta
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
NX_VEGA_REST=https://api.n11.testnet.vega.xyz
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf

View File

@ -2,6 +2,7 @@ import * as Sentry from '@sentry/react';
import { toBigNum } from '@vegaprotocol/react-helpers';
import { Splash } from '@vegaprotocol/ui-toolkit';
import { useVegaWallet, useEagerConnect } from '@vegaprotocol/wallet';
import { useEnvironment } from '@vegaprotocol/environment';
import { useWeb3React } from '@web3-react/core';
import React from 'react';
import { useTranslation } from 'react-i18next';
@ -15,12 +16,12 @@ import {
} from './contexts/app-state/app-state-context';
import { useContracts } from './contexts/contracts/contracts-context';
import { useRefreshAssociatedBalances } from './hooks/use-refresh-associated-balances';
import { getDataNodeUrl } from './lib/get-data-node-url';
import { Connectors } from './lib/vega-connectors';
export const AppLoader = ({ children }: { children: React.ReactElement }) => {
const { t } = useTranslation();
const { account } = useWeb3React();
const { VEGA_URL } = useEnvironment();
const { keypair } = useVegaWallet();
const { appDispatch } = useAppState();
const { token, staking, vesting } = useContracts();
@ -73,9 +74,8 @@ export const AppLoader = ({ children }: { children: React.ReactElement }) => {
}, [setAssociatedBalances, account, keypair]);
React.useEffect(() => {
const { base } = getDataNodeUrl();
const networkLimitsEndpoint = new URL('/network/limits', base).href;
const statsEndpoint = new URL('/statistics', base).href;
const networkLimitsEndpoint = new URL('/network/limits', VEGA_URL).href;
const statsEndpoint = new URL('/statistics', VEGA_URL).href;
// eslint-disable-next-line
let interval: any = null;
@ -137,7 +137,7 @@ export const AppLoader = ({ children }: { children: React.ReactElement }) => {
return () => {
stopPoll();
};
}, [appDispatch, t]);
}, [appDispatch, VEGA_URL, t]);
if (Flags.NETWORK_DOWN) {
return (

View File

@ -1,6 +1,8 @@
import './i18n';
import React, { useMemo } from 'react';
import React, { useMemo, useEffect } from 'react';
import * as Sentry from '@sentry/react';
import { Integrations } from '@sentry/tracing';
import { BrowserRouter as Router } from 'react-router-dom';
import { AppLoader } from './app-loader';
import { NetworkInfo } from '@vegaprotocol/network-info';
@ -25,17 +27,47 @@ import {
} from '@vegaprotocol/environment';
import { createClient } from './lib/apollo-client';
import { createConnectors } from './lib/web3-connectors';
import { ENV } from './config/env';
const AppContainer = () => {
const sideBar = React.useMemo(() => [<EthWallet />, <VegaWallet />], []);
const { config, loading, error } = useEthereumConfig();
const { ETHEREUM_PROVIDER_URL } = useEnvironment();
const { VEGA_ENV, GIT_COMMIT_HASH, GIT_BRANCH, ETHEREUM_PROVIDER_URL } =
useEnvironment();
const Connectors = useMemo(() => {
if (config?.chain_id) {
return createConnectors(ETHEREUM_PROVIDER_URL, Number(config.chain_id));
}
return undefined;
}, [config?.chain_id, ETHEREUM_PROVIDER_URL]);
useEffect(() => {
if (ENV.dsn) {
Sentry.init({
dsn: ENV.dsn,
integrations: [new Integrations.BrowserTracing()],
tracesSampleRate: 0.1,
enabled: true,
environment: VEGA_ENV,
release: GIT_COMMIT_HASH,
beforeSend(event) {
if (event.request?.url?.includes('/claim?')) {
return {
...event,
request: {
...event.request,
url: event.request?.url.split('?')[0],
},
};
}
return event;
},
});
Sentry.setTag('branch', GIT_BRANCH);
Sentry.setTag('commit', GIT_COMMIT_HASH);
}
}, [GIT_COMMIT_HASH, GIT_BRANCH, VEGA_ENV]);
return (
<Router>
<AppStateProvider>

View File

@ -197,14 +197,16 @@ export const usePollForDelegations = () => {
new BigNumber(a.currentEpochStake || 0).isLessThan(
b.currentEpochStake || 0
)
)
) {
return 1;
}
if (
new BigNumber(a.currentEpochStake || 0).isGreaterThan(
b.currentEpochStake || 0
)
)
) {
return -1;
}
if ((!a.name && b.name) || a.name < b.name) return 1;
if ((!b.name && a.name) || a.name > b.name) return -1;
if (a.nodeId > b.nodeId) return 1;

View File

@ -47,11 +47,6 @@ const envName = windowOrDefault('NX_VEGA_ENV') ?? 'local';
export const ENV = {
// Environment
dsn: windowOrDefault('NX_SENTRY_DSN'),
envName,
commit: windowOrDefault('NX_COMMIT_REF'),
branch: windowOrDefault('NX_BRANCH'),
vegaUrl: windowOrDefault('NX_VEGA_URL'),
restUrl: windowOrDefault('NX_VEGA_REST'),
urlConnect: TRUTHY.includes(windowOrDefault('NX_ETH_URL_CONNECT')),
ethWalletMnemonic: windowOrDefault('NX_ETH_WALLET_MNEMONIC'),
localProviderUrl: windowOrDefault('NX_LOCAL_PROVIDER_URL'),

View File

@ -10,7 +10,7 @@ describe('formatNumber and formatNumberPercentage', () => {
{ v: new BigNumber(123), d: undefined, o: '123.00' }, // it default to 2 decimal places
{ v: new BigNumber(30000), d: undefined, o: '30,000.00' },
{ v: new BigNumber(3.000001), d: undefined, o: '3.000001' },
])('formats given number correctly', ({ v, d, o }) => {
])(`formats given number with decimals correctly`, ({ v, d, o }) => {
expect(formatNumber(v, d)).toStrictEqual(o);
});
});

View File

@ -4,6 +4,6 @@ import { formatNumber as format } from '@vegaprotocol/react-helpers';
export const formatNumber = (value: BigNumber, decimals?: number) => {
return format(
value,
typeof decimals === 'undefined' ? Math.max(value.dp() || 0, 2) : decimals
typeof decimals === 'undefined' ? Math.max(value.dp() ?? 0, 2) : decimals
);
};

View File

@ -1,18 +0,0 @@
import { ENV } from '../config/env';
export function getDataNodeUrl() {
const base = ENV.vegaUrl;
if (!base) {
throw new Error('Environment variable NX_VEGA_URL must be set');
}
const urlHTTP = new URL(base);
const urlWS = new URL(base);
// Replace http with ws, preserving if its a secure connection eg. https => wss
urlWS.protocol = urlWS.protocol.replace('http', 'ws');
return {
base,
graphql: urlHTTP.href,
graphqlWebsocket: urlWS.href,
};
}

View File

@ -34,8 +34,9 @@ export class CustomizedBridge extends Eip1193Bridge {
// If from is present on eth_call it errors, removing it makes the library set
// from as the connected wallet which works fine
if (params && params.length && params[0].from && method === 'eth_call')
if (params && params.length && params[0].from && method === 'eth_call') {
delete params[0].from;
}
let result;
// For sending a transaction if we call send it will error
// as it wants gasLimit in sendTransaction but hexlify sets the property gas

View File

@ -1,43 +1,10 @@
import './styles.css';
import * as Sentry from '@sentry/react';
import { Integrations } from '@sentry/tracing';
import { createRoot } from 'react-dom/client';
import App from './app';
import reportWebVitals from './report-web-vitals';
import { ENV } from './config/env';
import { StrictMode } from 'react';
const dsn = ENV.dsn || false;
const environment = ENV.envName || 'local';
const commit = ENV.commit || 'local';
const branch = ENV.branch || 'unknown';
/* istanbul ignore next */
if (dsn) {
Sentry.init({
dsn,
integrations: [new Integrations.BrowserTracing()],
tracesSampleRate: 0.1,
enabled: environment !== 'local',
environment,
release: commit,
beforeSend(event) {
if (event.request?.url?.includes('/claim?')) {
return {
...event,
request: { ...event.request, url: event.request?.url.split('?')[0] },
};
}
return event;
},
});
Sentry.setTag('branch', branch);
Sentry.setTag('commit', commit);
}
const rootElement = document.getElementById('root');
const root = rootElement && createRoot(rootElement);

View File

@ -208,39 +208,6 @@ describe('Proposal header', () => {
expect(screen.getByTestId('proposal-details')).toHaveTextContent('long');
});
it('Renders Freeform proposal - extra long rationale (165 chars)', () => {
render(
renderComponent(
generateProposal({
id: 'extraLong',
rationale: {
title:
'Aenean sem odio, eleifend non sodales vitae, porttitor eu ex. Aliquam erat volutpat. Fusce pharetra libero quis risus lobortis, sed ornare leo efficitur turpis duis.',
description:
'Aenean sem odio, eleifend non sodales vitae, porttitor eu ex. Aliquam erat volutpat. Fusce pharetra libero quis risus lobortis, sed ornare leo efficitur turpis duis.',
},
terms: {
change: {
__typename: 'NewFreeform',
},
},
})
)
);
// For a rationale over 160 chars, we expect the header to be truncated at 100
// chars with ellipsis and the details-one element to contain 60 chars and also
// be truncated with an ellipsis.
expect(screen.getByTestId('proposal-title')).toHaveTextContent(
'Aenean sem odio, eleifend non sodales vitae, porttitor eu ex. Aliquam erat volutpat. Fusce pharetra…'
);
expect(screen.getByTestId('proposal-description')).toHaveTextContent(
'Aenean sem odio, eleifend non sodales vitae, porttitor eu e…'
);
expect(screen.getByTestId('proposal-details')).toHaveTextContent(
'extraLong'
);
});
// Remove once proposals have rationale and re-enable above tests
it('Renders Freeform proposal - id for title', () => {
render(

View File

@ -18,7 +18,6 @@ export const ProposalHeader = ({ proposal }: { proposal: ProposalFields }) => {
}
const titleContent = shorten(title, 100);
const descriptionContent = shorten(description, 60);
switch (change.__typename) {
case 'NewMarket': {
@ -90,15 +89,9 @@ export const ProposalHeader = ({ proposal }: { proposal: ProposalFields }) => {
{titleContent || t('Unknown proposal')}
</h2>
</header>
{descriptionContent && (
<div
className="mb-4"
{...(description.length > descriptionContent.length && {
title: description,
})}
data-testid="proposal-description"
>
{descriptionContent}
{description && (
<div className="mb-4" data-testid="proposal-description">
{description}
</div>
)}
{details && <div data-testid="proposal-details">{details}</div>}

View File

@ -30,7 +30,7 @@ module.exports = defineConfig({
viewportWidth: 1440,
viewportHeight: 900,
responseTimeout: 50000,
requestTimeout: 10000,
requestTimeout: 20000,
},
env: {
TRADING_TEST_VEGA_WALLET_NAME: 'UI_Trading_Test',

View File

@ -10,7 +10,7 @@ export const generateCandles = (
): CandlesQuery => {
const candles: CandleFieldsFragment[] = [
{
datetime: '2022-04-06T09:15:00Z',
timestamp: '1661515200000000000',
high: '17481092',
low: '17403651',
open: '17458833',
@ -19,7 +19,7 @@ export const generateCandles = (
__typename: 'Candle',
},
{
datetime: '2022-04-06T09:30:00Z',
timestamp: '1661516100000000000',
high: '17491202',
low: '17361138',
open: '17446470',
@ -28,7 +28,7 @@ export const generateCandles = (
__typename: 'Candle',
},
{
datetime: '2022-04-06T09:45:00Z',
timestamp: '1661517000000000000',
high: '17424522',
low: '17337719',
open: '17367174',

View File

@ -1,7 +1,7 @@
# App configuration variables
NX_VEGA_ENV=MAINNET
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/mainnet-network.json
NX_VEGA_URL=https://api.token.vega.xyz/query
NX_VEGA_URL=https://api.vega.xyz/query
NX_VEGA_NETWORKS='{\"MAINNET\":\"https://alpha.console.vega.xyz\"}'
NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://etherscan.io

View File

@ -12,10 +12,9 @@ const windowOrDefault = (key: string, defaultValue?: string) => {
* So must provide the default with the key so that next can figure it out.
*/
export const ENV = {
envName: windowOrDefault('NX_VEGA_ENV', process.env['NX_VEGA_ENV']),
dsn: windowOrDefault(
'NX_TRADING_SENTRY_DSN',
process.env['NX_TRADING_SENTRY_DSN']
),
envName: windowOrDefault('NX_VEGA_ENV', process.env['NX_VEGA_ENV']),
vegaUrl: windowOrDefault('NX_VEGA_URL', process.env['NX_VEGA_URL']),
};

Some files were not shown because too many files have changed in this diff Show More