From d238662c9de5e66c7da726fac8af860d027058a3 Mon Sep 17 00:00:00 2001 From: Matthew Russell Date: Thu, 28 Mar 2024 15:00:01 +0000 Subject: [PATCH] fix(trading,governance): align validator testnet name, add chain config (#6133) --- apps/explorer/.env.validators-testnet | 2 +- apps/governance/.env.validators-testnet | 2 +- apps/governance/src/config/env.ts | 2 +- apps/governance/src/hooks/use-vega-wallet-config.ts | 3 ++- apps/multisig-signer/.env.validators-testnet | 2 +- apps/trading/.env.validators-testnet | 2 +- apps/trading/lib/hooks/use-vega-wallet-config.ts | 3 ++- libs/environment/src/chains.ts | 2 +- .../network-switcher/network-switcher.spec.tsx | 6 +++--- .../src/components/network-switcher/network-switcher.tsx | 4 ++-- libs/environment/src/hooks/use-links.ts | 6 +++--- libs/environment/src/types.ts | 2 +- libs/i18n/src/locales/en/deal-ticket.json | 2 +- libs/i18n/src/locales/en/environment.json | 2 +- libs/wallet/src/chains.ts | 6 ++++++ libs/wallet/src/index.ts | 9 ++++++++- tools/ci/define-dist-variables.py | 2 +- 17 files changed, 36 insertions(+), 21 deletions(-) diff --git a/apps/explorer/.env.validators-testnet b/apps/explorer/.env.validators-testnet index 8b58d3b8f..e50af065f 100644 --- a/apps/explorer/.env.validators-testnet +++ b/apps/explorer/.env.validators-testnet @@ -1,5 +1,5 @@ # App configuration variables -NX_VEGA_ENV=VALIDATOR_TESTNET +NX_VEGA_ENV=VALIDATORS_TESTNET NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/testnet2/testnet2.toml NX_VEGA_URL=https://api-validators-testnet.vega.rocks/graphql NX_VEGA_REST=https://api-validators-testnet.vega.rocks/ diff --git a/apps/governance/.env.validators-testnet b/apps/governance/.env.validators-testnet index 4cabe332e..512d82f86 100644 --- a/apps/governance/.env.validators-testnet +++ b/apps/governance/.env.validators-testnet @@ -1,5 +1,5 @@ # App configuration variables -NX_VEGA_ENV=VALIDATOR_TESTNET +NX_VEGA_ENV=VALIDATORS_TESTNET NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/testnet2/testnet2.toml NX_VEGA_URL=https://api-validators-testnet.vega.rocks/graphql NX_VEGA_REST=https://api-validators-testnet.vega.rocks/ diff --git a/apps/governance/src/config/env.ts b/apps/governance/src/config/env.ts index 755d5e932..68de86de7 100644 --- a/apps/governance/src/config/env.ts +++ b/apps/governance/src/config/env.ts @@ -41,7 +41,7 @@ export const ContractAddresses: { claimAddress: '0x8Cef746ab7C83B61F6461cC92882bD61AB65a994', // TODO not deployed to this env, but random address so app doesn't error lockedAddress: '0x0', // TODO not deployed to this env }, - VALIDATOR_TESTNET: { + VALIDATORS_TESTNET: { claimAddress: '0x8Cef746ab7C83B61F6461cC92882bD61AB65a994', // TODO not deployed to this env, but random address so app doesn't error lockedAddress: '0x0', // TODO not deployed to this env // This is a fallback contract address for the validator testnet network which does not diff --git a/apps/governance/src/hooks/use-vega-wallet-config.ts b/apps/governance/src/hooks/use-vega-wallet-config.ts index 109dca585..f2bbf0583 100644 --- a/apps/governance/src/hooks/use-vega-wallet-config.ts +++ b/apps/governance/src/hooks/use-vega-wallet-config.ts @@ -6,6 +6,7 @@ import { ViewPartyConnector, createConfig, fairground, + validatorsTestnet, stagnet, mainnet, } from '@vegaprotocol/wallet'; @@ -31,7 +32,7 @@ export const useVegaWalletConfig = () => { const viewParty = new ViewPartyConnector(); const config = createConfig({ - chains: [mainnet, fairground, stagnet], + chains: [mainnet, fairground, validatorsTestnet, stagnet], defaultChainId: CHAIN_IDS[VEGA_ENV], connectors: [injected, snap, jsonRpc, viewParty], }); diff --git a/apps/multisig-signer/.env.validators-testnet b/apps/multisig-signer/.env.validators-testnet index 27ac7973d..bbacec098 100644 --- a/apps/multisig-signer/.env.validators-testnet +++ b/apps/multisig-signer/.env.validators-testnet @@ -2,4 +2,4 @@ NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/testnet2/testnet2.tom NX_VEGA_URL=https://api-validators-testnet.vega.rocks/graphql NX_VEGA_NETWORKS={'{"TESTNET":"https://multisig-signer.fairground.wtf","MAINNET":"https://multisig-signer.vega.xyz"}' -NX_VEGA_ENV=VALIDATOR_TESTNET +NX_VEGA_ENV=VALIDATORS_TESTNET diff --git a/apps/trading/.env.validators-testnet b/apps/trading/.env.validators-testnet index caf021109..dd0578780 100644 --- a/apps/trading/.env.validators-testnet +++ b/apps/trading/.env.validators-testnet @@ -4,7 +4,7 @@ NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz NX_SENTRY_DSN=https://2ffce43721964aafa78277c50654ece4@o286262.ingest.sentry.io/6300613 NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/testnet2/testnet2.toml -NX_VEGA_ENV=VALIDATOR_TESTNET +NX_VEGA_ENV=VALIDATORS_TESTNET NX_VEGA_EXPLORER_URL=https://explorer.validators-testnet.vega.rocks NX_VEGA_NETWORKS={\"MAINNET\":\"https://console.vega.xyz\",\"STAGNET1\":\"https://trading.stagnet1.vega.rocks\",\"TESTNET\":\"https://console.fairground.wtf\"} NX_VEGA_TOKEN_URL=https://governance.validators-testnet.vega.rocks diff --git a/apps/trading/lib/hooks/use-vega-wallet-config.ts b/apps/trading/lib/hooks/use-vega-wallet-config.ts index 2fb28663d..4a4e7db95 100644 --- a/apps/trading/lib/hooks/use-vega-wallet-config.ts +++ b/apps/trading/lib/hooks/use-vega-wallet-config.ts @@ -5,6 +5,7 @@ import { ViewPartyConnector, createConfig, fairground, + validatorsTestnet, mainnet, stagnet, } from '@vegaprotocol/wallet'; @@ -36,7 +37,7 @@ export const useVegaWalletConfig = () => { const viewParty = new ViewPartyConnector(); const config = createConfig({ - chains: [mainnet, fairground, stagnet], + chains: [mainnet, fairground, validatorsTestnet, stagnet], defaultChainId: CHAIN_IDS[VEGA_ENV], connectors: [injected, snap, jsonRpc, viewParty], }); diff --git a/libs/environment/src/chains.ts b/libs/environment/src/chains.ts index ce6fb46ff..e2a9f2f3a 100644 --- a/libs/environment/src/chains.ts +++ b/libs/environment/src/chains.ts @@ -7,7 +7,7 @@ export const CHAIN_IDS: { [Networks.STAGNET1]: 'vega-stagnet1-202307191148', [Networks.TESTNET]: 'vega-fairground-202305051805', [Networks.MAINNET_MIRROR]: '', - [Networks.VALIDATOR_TESTNET]: 'testnet-001', + [Networks.VALIDATORS_TESTNET]: 'vega-testnet-0002-v4', [Networks.CUSTOM]: 'vega-stagnet1-202307191148', [Networks.MAINNET]: 'vega-mainnet-0011', }; diff --git a/libs/environment/src/components/network-switcher/network-switcher.spec.tsx b/libs/environment/src/components/network-switcher/network-switcher.spec.tsx index 745b4bb3e..724860bdd 100644 --- a/libs/environment/src/components/network-switcher/network-switcher.spec.tsx +++ b/libs/environment/src/components/network-switcher/network-switcher.spec.tsx @@ -160,7 +160,7 @@ describe('Network switcher', () => { [Networks.CUSTOM]: undefined, [Networks.MAINNET]: 'https://main.net', [Networks.TESTNET]: 'https://test.net', - [Networks.VALIDATOR_TESTNET]: 'https://validator-test.net', + [Networks.VALIDATORS_TESTNET]: 'https://validator-test.net', [Networks.MAINNET_MIRROR]: 'https://mainnet-mirror.net', [Networks.DEVNET]: 'https://dev.net', [Networks.STAGNET1]: 'https://stag1.net', @@ -196,7 +196,7 @@ describe('Network switcher', () => { const VEGA_NETWORKS: Record = { [Networks.CUSTOM]: undefined, [Networks.MAINNET]: 'https://main.net', - [Networks.VALIDATOR_TESTNET]: 'https://validator-test.net', + [Networks.VALIDATORS_TESTNET]: 'https://validator-test.net', [Networks.MAINNET_MIRROR]: 'https://mainnet-mirror.net', [Networks.TESTNET]: 'https://test.net', [Networks.DEVNET]: 'https://dev.net', @@ -226,7 +226,7 @@ describe('Network switcher', () => { const VEGA_NETWORKS: Record = { [Networks.CUSTOM]: undefined, [Networks.MAINNET]: undefined, - [Networks.VALIDATOR_TESTNET]: 'https://validator-test.net', + [Networks.VALIDATORS_TESTNET]: 'https://validator-test.net', [Networks.MAINNET_MIRROR]: 'https://mainnet-mirror.net', [Networks.TESTNET]: 'https://test.net', [Networks.DEVNET]: 'https://dev.net', diff --git a/libs/environment/src/components/network-switcher/network-switcher.tsx b/libs/environment/src/components/network-switcher/network-switcher.tsx index 89664a3a6..de673b4b2 100644 --- a/libs/environment/src/components/network-switcher/network-switcher.tsx +++ b/libs/environment/src/components/network-switcher/network-switcher.tsx @@ -17,7 +17,7 @@ import { useT } from '../../use-t'; export const useEnvNameMapping: () => Record = () => { const t = useT(); return { - [Networks.VALIDATOR_TESTNET]: t('VALIDATOR_TESTNET', { + [Networks.VALIDATORS_TESTNET]: t('VALIDATORS_TESTNET', { contextSeparator: '|', }), [Networks.MAINNET_MIRROR]: t('Mainnet-mirror'), @@ -41,7 +41,7 @@ export const useEnvDescriptionMapping: () => Record = () => { const t = useT(); return { [Networks.CUSTOM]: '', - [Networks.VALIDATOR_TESTNET]: t('The validator deployed testnet'), + [Networks.VALIDATORS_TESTNET]: t('The validator deployed testnet'), [Networks.MAINNET_MIRROR]: t('The mainnet-mirror network'), [Networks.DEVNET]: t('The latest Vega code auto-deployed'), [Networks.STAGNET1]: t('A release candidate for the staging environment'), diff --git a/libs/environment/src/hooks/use-links.ts b/libs/environment/src/hooks/use-links.ts index fb24b77dc..e1cf1ea5f 100644 --- a/libs/environment/src/hooks/use-links.ts +++ b/libs/environment/src/hooks/use-links.ts @@ -20,7 +20,7 @@ type DAppLinks = { }; const EmptyLinks: DAppLinks = { - [Networks.VALIDATOR_TESTNET]: '', + [Networks.VALIDATORS_TESTNET]: '', [Networks.MAINNET_MIRROR]: '', [Networks.DEVNET]: '', [Networks.STAGNET1]: '', @@ -32,7 +32,7 @@ const ExplorerLinks = { ...EmptyLinks, [Networks.STAGNET1]: 'https://explorer.stagnet1.vega.rocks', [Networks.TESTNET]: 'https://explorer.fairground.wtf', - [Networks.VALIDATOR_TESTNET]: + [Networks.VALIDATORS_TESTNET]: 'https://explorer.validators-testnet.vega.rocks', [Networks.MAINNET_MIRROR]: 'https://explorer.mainnet-mirror.vega.rocks/', [Networks.MAINNET]: 'https://explorer.vega.xyz', @@ -51,7 +51,7 @@ const GovernanceLinks = { [Networks.DEVNET]: 'https://dev.governance.vega.xyz', [Networks.STAGNET1]: 'https://governance.stagnet1.vega.rocks', [Networks.TESTNET]: 'https://governance.fairground.wtf', - [Networks.VALIDATOR_TESTNET]: + [Networks.VALIDATORS_TESTNET]: 'https://governance.validators-testnet.vega.rocks', [Networks.MAINNET_MIRROR]: 'https://governance.mainnet-mirror.vega.rocks', [Networks.MAINNET]: 'https://governance.vega.xyz', diff --git a/libs/environment/src/types.ts b/libs/environment/src/types.ts index 3c5b2e82c..a05eb5a9f 100644 --- a/libs/environment/src/types.ts +++ b/libs/environment/src/types.ts @@ -6,7 +6,7 @@ import type { } from './utils/validate-environment'; export enum Networks { - VALIDATOR_TESTNET = 'VALIDATOR_TESTNET', + VALIDATORS_TESTNET = 'VALIDATORS_TESTNET', MAINNET_MIRROR = 'MAINNET_MIRROR', CUSTOM = 'CUSTOM', TESTNET = 'TESTNET', diff --git a/libs/i18n/src/locales/en/deal-ticket.json b/libs/i18n/src/locales/en/deal-ticket.json index 203697f8d..48d871f33 100644 --- a/libs/i18n/src/locales/en/deal-ticket.json +++ b/libs/i18n/src/locales/en/deal-ticket.json @@ -154,7 +154,7 @@ "TYPE_SELECTOR_LIQUIDITY_MONITORING_AUCTION": "This market is in auction until it reaches <0>sufficient liquidity. Only limit orders are permitted when market is in auction.", "TYPE_SELECTOR_PRICE_MONITORING_AUCTION": "This market is in auction due to <0>high price volatility. Only limit orders are permitted when market is in auction.", "Until the auction ends, you can only place GFA, GTT, or GTC limit orders": "Until the auction ends, you can only place GFA, GTT, or GTC limit orders", - "VALIDATOR_TESTNET": "VALIDATOR_TESTNET", + "VALIDATORS_TESTNET": "VALIDATORS_TESTNET", "Volume discount": "Volume discount", "When the order trades and its size falls below this threshold, it will be reset to the peak size and moved to the back of the priority order. Must be less than or equal to peak size, and greater than 0.": "When the order trades and its size falls below this threshold, it will be reset to the peak size and moved to the back of the priority order. Must be less than or equal to peak size, and greater than 0.", "You are setting this market to cross-margin mode.": "You are setting this market to cross-margin mode.", diff --git a/libs/i18n/src/locales/en/environment.json b/libs/i18n/src/locales/en/environment.json index 31dd75d38..d9d93a389 100644 --- a/libs/i18n/src/locales/en/environment.json +++ b/libs/i18n/src/locales/en/environment.json @@ -36,7 +36,7 @@ "The validator deployed testnet": "The validator deployed testnet", "The vega mainnet": "The vega mainnet", "This app will only work on {{VEGA_ENV}}. Select a node to connect to.": "This app will only work on {{VEGA_ENV}}. Select a node to connect to.", - "VALIDATOR_TESTNET": "VALIDATOR_TESTNET", + "VALIDATORS_TESTNET": "VALIDATORS_TESTNET", "View on Etherscan (opens in a new tab)": "View on Etherscan (opens in a new tab)", "View on {{chainLabel}} (opens in a new tab)": "View on {{chainLabel}} (opens in a new tab)", "Warning delay ( >{{warningLatency}} sec): {{blockUpdateLatency}} sec": "Warning delay ( >{{warningLatency}} sec): {{blockUpdateLatency}} sec", diff --git a/libs/wallet/src/chains.ts b/libs/wallet/src/chains.ts index 9bec5d47a..798407c52 100644 --- a/libs/wallet/src/chains.ts +++ b/libs/wallet/src/chains.ts @@ -16,6 +16,12 @@ export const fairground = { name: 'Fairground', }; +export const validatorsTestnet = { + id: 'vega-testnet-0002-v4', + testnet: true, + name: 'Validators Testnet', +}; + export const stagnet = { id: 'vega-stagnet1-202307191148', testnet: true, diff --git a/libs/wallet/src/index.ts b/libs/wallet/src/index.ts index 3ba2ab306..b99b77ed6 100644 --- a/libs/wallet/src/index.ts +++ b/libs/wallet/src/index.ts @@ -3,7 +3,14 @@ export * from './types'; export * from './transaction-types'; // Core -export { mainnet, fairground, stagnet, mockChain, type Chain } from './chains'; +export { + mainnet, + fairground, + validatorsTestnet, + stagnet, + mockChain, + type Chain, +} from './chains'; export { createConfig, coreStoreSlice, singleKeyStoreSlice } from './wallet'; // Connectors diff --git a/tools/ci/define-dist-variables.py b/tools/ci/define-dist-variables.py index 19aa5f400..e9643c1c5 100644 --- a/tools/ci/define-dist-variables.py +++ b/tools/ci/define-dist-variables.py @@ -16,7 +16,7 @@ bucket_name = '' if 'release/' in args.github_ref: if 'mainnet-mirror' in args.github_ref: env_name = 'mainnet-mirror' - elif 'validators-testnet' in args.github_ref or 'validator-testnet' in args.github_ref: + elif 'validators-testnet' in args.github_ref: env_name = 'validators-testnet' else: # remove prefixing release/ and take the first string limited by - which is supposed to be name of the environment for releasing (format: release/testnet-trading)