From d6583f596912c6190330dcafad2bef68313846dd Mon Sep 17 00:00:00 2001 From: Dexter Edwards Date: Tue, 4 Oct 2022 23:24:27 +0100 Subject: [PATCH] chore: sepolia migration (#1517) * chore: seoplia migration * fix: remove trailing slash from etherscan urls * fix: make mock assets for withdraw form real assets so working with infura works * chore: remove stray screen.debug * fix: global mocks for chainid * fix: add additional chain id mock for withdrawals page Co-authored-by: Matthew Russell --- apps/console-lite-e2e/cypress.config.js | 4 +- apps/console-lite-e2e/src/support/index.js | 2 +- apps/console-lite/.env | 4 +- apps/console-lite/.env.devnet | 4 +- apps/console-lite/.env.stagnet3 | 4 +- apps/console-lite/.env.testnet | 4 +- apps/explorer-e2e/cypress.config.js | 2 +- apps/liquidity-provision-dashboard/.env | 4 +- .../liquidity-provision-dashboard/.env.devnet | 4 +- .../.env.stagnet3 | 4 +- .../.env.testnet | 4 +- apps/token-e2e/.env | 2 +- apps/token-e2e/.env.devnet | 4 +- apps/token-e2e/.env.stagnet3 | 4 +- apps/token-e2e/.env.testnet | 4 +- apps/token-e2e/src/support/index.js | 2 +- apps/token/.env | 4 +- apps/token/.env.capsule | 2 +- apps/token/.env.devnet | 4 +- apps/token/.env.testnet | 4 +- apps/token/README.md | 1 - .../contexts/app-state/app-state-context.ts | 2 +- apps/trading-e2e/cypress.config.js | 5 ++- apps/trading-e2e/src/integration/global.cy.ts | 5 +-- .../src/integration/withdraw.cy.ts | 15 +++---- apps/trading-e2e/src/support/index.js | 7 ++-- .../src/support/mocks/generate-chain-id.ts | 16 ++++++++ .../mocks/generate-network-parameters.ts | 8 ++-- .../mocks/generate-withdraw-page-query.ts | 40 ++++++++++--------- apps/trading/.env | 4 +- apps/trading/.env.devnet | 6 +-- apps/trading/.env.stagnet3 | 6 +-- apps/trading/.env.testnet | 6 +-- libs/cypress/src/lib/eip1193-bridge.ts | 10 ++--- .../src/hooks/use-environment.spec.tsx | 6 +-- .../src/utils/compile-environment.ts | 4 +- libs/fills/src/lib/fills-table.spec.tsx | 1 - libs/smart-contracts/src/contracts/claim.ts | 4 +- scripts/get-tranches.js | 6 +-- 39 files changed, 120 insertions(+), 102 deletions(-) create mode 100644 apps/trading-e2e/src/support/mocks/generate-chain-id.ts diff --git a/apps/console-lite-e2e/cypress.config.js b/apps/console-lite-e2e/cypress.config.js index e0f49d139..93994c5b5 100644 --- a/apps/console-lite-e2e/cypress.config.js +++ b/apps/console-lite-e2e/cypress.config.js @@ -25,7 +25,7 @@ module.exports = defineConfig({ env: { TRADING_TEST_VEGA_WALLET_NAME: 'UI_Trading_Test', ETHEREUM_PROVIDER_URL: - 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8', + 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8', VEGA_PUBLIC_KEY: '47836c253520d2661bf5bed6339c0de08fd02cf5d4db0efee3b4373f20c7d278', VEGA_PUBLIC_KEY2: @@ -33,7 +33,7 @@ module.exports = defineConfig({ TRUNCATED_VEGA_PUBLIC_KEY: '47836c…c7d278', TRUNCATED_VEGA_PUBLIC_KEY2: '1a18cd…0cf2e4', ETHEREUM_WALLET_ADDRESS: '0x265Cc6d39a1B53d0d92068443009eE7410807158', - ETHERSCAN_URL: 'https://ropsten.etherscan.io', + ETHERSCAN_URL: 'https://sepolia.etherscan.io', tsConfig: 'tsconfig.json', TAGS: 'not @todo and not @ignore and not @manual', TRADING_TEST_VEGA_WALLET_PASSPHRASE: '123', diff --git a/apps/console-lite-e2e/src/support/index.js b/apps/console-lite-e2e/src/support/index.js index 515cc674b..6cd3f555b 100644 --- a/apps/console-lite-e2e/src/support/index.js +++ b/apps/console-lite-e2e/src/support/index.js @@ -21,7 +21,7 @@ import registerCypressGrep from 'cypress-grep'; import { aliasQuery } from '@vegaprotocol/cypress'; registerCypressGrep(); -beforeEach(() => { +before(() => { // Mock chainId fetch which happens on every page for wallet connection cy.mockGQL((req) => { aliasQuery(req, 'ChainId', { diff --git a/apps/console-lite/.env b/apps/console-lite/.env index a7c845cb7..2e6533105 100644 --- a/apps/console-lite/.env +++ b/apps/console-lite/.env @@ -21,7 +21,7 @@ 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 -NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 -NX_ETHERSCAN_URL=https://ropsten.etherscan.io +NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_VEGA_NETWORKS={"MAINNET":"https://alpha.console.vega.xyz"} NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf diff --git a/apps/console-lite/.env.devnet b/apps/console-lite/.env.devnet index 26a7e5a62..3ec0c215f 100644 --- a/apps/console-lite/.env.devnet +++ b/apps/console-lite/.env.devnet @@ -3,6 +3,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_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_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_VEGA_EXPLORER_URL=https://dev.explorer.vega.xyz diff --git a/apps/console-lite/.env.stagnet3 b/apps/console-lite/.env.stagnet3 index f682f03a0..7e05de2fd 100644 --- a/apps/console-lite/.env.stagnet3 +++ b/apps/console-lite/.env.stagnet3 @@ -2,6 +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_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 -NX_ETHERSCAN_URL=https://ropsten.etherscan.io +NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_VEGA_EXPLORER_URL=https://staging2.explorer.vega.xyz diff --git a/apps/console-lite/.env.testnet b/apps/console-lite/.env.testnet index ec2a25e07..3500d6bca 100644 --- a/apps/console-lite/.env.testnet +++ b/apps/console-lite/.env.testnet @@ -3,6 +3,6 @@ NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/testnet-network.json NX_VEGA_URL=https://api.n12.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_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf diff --git a/apps/explorer-e2e/cypress.config.js b/apps/explorer-e2e/cypress.config.js index 92820b49b..70a5a9970 100644 --- a/apps/explorer-e2e/cypress.config.js +++ b/apps/explorer-e2e/cypress.config.js @@ -25,7 +25,7 @@ module.exports = defineConfig({ env: { environment: 'CUSTOM', networkQueryUrl: 'http://localhost:3028/query', - ethUrl: 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8', + ethUrl: 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8', commitHash: 'dev', CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true, tsConfig: 'tsconfig.json', diff --git a/apps/liquidity-provision-dashboard/.env b/apps/liquidity-provision-dashboard/.env index a7c845cb7..2e6533105 100644 --- a/apps/liquidity-provision-dashboard/.env +++ b/apps/liquidity-provision-dashboard/.env @@ -21,7 +21,7 @@ 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 -NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 -NX_ETHERSCAN_URL=https://ropsten.etherscan.io +NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_VEGA_NETWORKS={"MAINNET":"https://alpha.console.vega.xyz"} NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf diff --git a/apps/liquidity-provision-dashboard/.env.devnet b/apps/liquidity-provision-dashboard/.env.devnet index 26a7e5a62..3ec0c215f 100644 --- a/apps/liquidity-provision-dashboard/.env.devnet +++ b/apps/liquidity-provision-dashboard/.env.devnet @@ -3,6 +3,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_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_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_VEGA_EXPLORER_URL=https://dev.explorer.vega.xyz diff --git a/apps/liquidity-provision-dashboard/.env.stagnet3 b/apps/liquidity-provision-dashboard/.env.stagnet3 index f682f03a0..7e05de2fd 100644 --- a/apps/liquidity-provision-dashboard/.env.stagnet3 +++ b/apps/liquidity-provision-dashboard/.env.stagnet3 @@ -2,6 +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_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 -NX_ETHERSCAN_URL=https://ropsten.etherscan.io +NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_VEGA_EXPLORER_URL=https://staging2.explorer.vega.xyz diff --git a/apps/liquidity-provision-dashboard/.env.testnet b/apps/liquidity-provision-dashboard/.env.testnet index 34be5e279..772fb1965 100644 --- a/apps/liquidity-provision-dashboard/.env.testnet +++ b/apps/liquidity-provision-dashboard/.env.testnet @@ -3,6 +3,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_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_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf diff --git a/apps/token-e2e/.env b/apps/token-e2e/.env index 235e5af78..6d8a0b2cb 100644 --- a/apps/token-e2e/.env +++ b/apps/token-e2e/.env @@ -1,7 +1,7 @@ # App configuration variables NX_VEGA_ENV=TESTNET NX_ETHEREUM_PROVIDER_URL=http://localhost:8545 -NX_ETHERSCAN_URL=https://ropsten.etherscan.io +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_FAIRGROUND=false NX_VEGA_NETWORKS={} diff --git a/apps/token-e2e/.env.devnet b/apps/token-e2e/.env.devnet index cc1179783..53db0acbd 100644 --- a/apps/token-e2e/.env.devnet +++ b/apps/token-e2e/.env.devnet @@ -1,5 +1,5 @@ # App configuration variables NX_VEGA_ENV=DEVNET NX_VEGA_URL=https://api.n04.d.vega.xyz/graphql -NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 -NX_ETHERSCAN_URL=https://ropsten.etherscan.io +NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io diff --git a/apps/token-e2e/.env.stagnet3 b/apps/token-e2e/.env.stagnet3 index 7dd92489a..7709c313e 100644 --- a/apps/token-e2e/.env.stagnet3 +++ b/apps/token-e2e/.env.stagnet3 @@ -1,5 +1,5 @@ # App configuration variables NX_VEGA_ENV=STAGNET3 NX_VEGA_URL=https://api.n01.stagnet3.vega.xyz/graphql -NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 -NX_ETHERSCAN_URL=https://ropsten.etherscan.io +NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io diff --git a/apps/token-e2e/.env.testnet b/apps/token-e2e/.env.testnet index 4e315df7d..631ab9296 100644 --- a/apps/token-e2e/.env.testnet +++ b/apps/token-e2e/.env.testnet @@ -1,5 +1,5 @@ # App configuration variables NX_VEGA_ENV=TESTNET NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql -NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 -NX_ETHERSCAN_URL=https://ropsten.etherscan.io +NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io diff --git a/apps/token-e2e/src/support/index.js b/apps/token-e2e/src/support/index.js index 90709736e..08cd5067a 100644 --- a/apps/token-e2e/src/support/index.js +++ b/apps/token-e2e/src/support/index.js @@ -20,7 +20,7 @@ if (!app.document.head.querySelector('[data-hide-command-log-request]')) { app.document.head.appendChild(style); } -beforeEach(() => { +before(() => { // Mock chainId fetch which happens on every page for wallet connection cy.mockGQL((req) => { aliasQuery(req, 'ChainId', { diff --git a/apps/token/.env b/apps/token/.env index 7d5a7cdc4..64e281df9 100644 --- a/apps/token/.env +++ b/apps/token/.env @@ -2,8 +2,8 @@ NX_VEGA_ENV=TESTNET 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_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io 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 diff --git a/apps/token/.env.capsule b/apps/token/.env.capsule index e8113a9bc..2102b4206 100644 --- a/apps/token/.env.capsule +++ b/apps/token/.env.capsule @@ -1,7 +1,7 @@ # App configuration variables NX_VEGA_ENV=CUSTOM NX_ETHEREUM_PROVIDER_URL=http://localhost:8545 -NX_ETHERSCAN_URL=https://ropsten.etherscan.io +NX_ETHERSCAN_URL=https://sepolia.etherscan.io 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 diff --git a/apps/token/.env.devnet b/apps/token/.env.devnet index f8d8c82da..1c96bbabc 100644 --- a/apps/token/.env.devnet +++ b/apps/token/.env.devnet @@ -3,8 +3,8 @@ 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_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 +NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_VEGA_EXPLORER_URL=https://dev.explorer.vega.xyz NX_VEGA_DOCS_URL=https://docs.vega.xyz/docs/testnet diff --git a/apps/token/.env.testnet b/apps/token/.env.testnet index 30203c0a2..f0e7e1b05 100644 --- a/apps/token/.env.testnet +++ b/apps/token/.env.testnet @@ -3,8 +3,8 @@ NX_VEGA_ENV=TESTNET NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/testnet-network.json NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql 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 +NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf NX_VEGA_DOCS_URL=https://docs.vega.xyz/docs/testnet diff --git a/apps/token/README.md b/apps/token/README.md index 229c8f2e7..6f0da8d72 100644 --- a/apps/token/README.md +++ b/apps/token/README.md @@ -40,7 +40,6 @@ There are a few different configuration options offered for this app: | **Flag** | **Purpose** | | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | `NX_APP_SENTRY_DSN` | The sentry endpoint to report to. Should be off in dev but set in live. | -| `NX_APP_CHAIN` | The ETH chain for the app to work on. Should be mainnet for live, but ropsten for preview deploys. | | `NX_APP_VEGA_URL` | The GraphQL query endpoint of a [Vega data node](https://github.com/vegaprotocol/networks#data-node) | | `NX_APP_DEX_STAKING_DISABLED` | Disable the dex liquidity page an show a coming soon message | | `NX_APP_FAIRGROUND` | Change styling to be themed as the fairground version of the website | diff --git a/apps/token/src/contexts/app-state/app-state-context.ts b/apps/token/src/contexts/app-state/app-state-context.ts index 1f4af80a3..06ef9ee0c 100644 --- a/apps/token/src/contexts/app-state/app-state-context.ts +++ b/apps/token/src/contexts/app-state/app-state-context.ts @@ -43,7 +43,7 @@ export interface AppState { /** Array of tranche objects */ tranches: Tranche[] | null; - /** Number of decimal places of the VEGA token (18 on Mainnet, 5 on Ropsten) */ + /** Number of decimal places of the VEGA token (18 on Mainnet, 5 on Testnet) */ decimals: number; /** Total supply of VEGA tokens */ diff --git a/apps/trading-e2e/cypress.config.js b/apps/trading-e2e/cypress.config.js index 051e347b4..782c1ad65 100644 --- a/apps/trading-e2e/cypress.config.js +++ b/apps/trading-e2e/cypress.config.js @@ -39,7 +39,7 @@ module.exports = defineConfig({ env: { TRADING_TEST_VEGA_WALLET_NAME: 'UI_Trading_Test', ETHEREUM_PROVIDER_URL: - 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8', + 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8', VEGA_PUBLIC_KEY: '47836c253520d2661bf5bed6339c0de08fd02cf5d4db0efee3b4373f20c7d278', VEGA_PUBLIC_KEY2: @@ -47,7 +47,8 @@ module.exports = defineConfig({ TRUNCATED_VEGA_PUBLIC_KEY: '47836c…c7d278', TRUNCATED_VEGA_PUBLIC_KEY2: '1a18cd…0cf2e4', ETHEREUM_WALLET_ADDRESS: '0x265Cc6d39a1B53d0d92068443009eE7410807158', - ETHERSCAN_URL: 'https://ropsten.etherscan.io', + ETHERSCAN_URL: 'https://sepolia.etherscan.io', + ETHEREUM_CHAIN_ID: 11155111, tsConfig: 'tsconfig.json', TAGS: 'not @todo and not @ignore and not @manual', TRADING_TEST_VEGA_WALLET_PASSPHRASE: '123', diff --git a/apps/trading-e2e/src/integration/global.cy.ts b/apps/trading-e2e/src/integration/global.cy.ts index 395cd2950..8797116ef 100644 --- a/apps/trading-e2e/src/integration/global.cy.ts +++ b/apps/trading-e2e/src/integration/global.cy.ts @@ -1,6 +1,7 @@ import { aliasQuery } from '@vegaprotocol/cypress'; import { connectVegaWallet } from '../support/vega-wallet'; import { generateNetworkParameters } from '../support/mocks/generate-network-parameters'; +import { generateChainId } from '../support/mocks/generate-chain-id'; describe('vega wallet', { tags: '@smoke' }, () => { const connectVegaBtn = 'connect-vega-wallet'; @@ -13,9 +14,7 @@ describe('vega wallet', { tags: '@smoke' }, () => { // Using portfolio page as it requires vega wallet connection cy.visit('/portfolio'); cy.mockGQL((req) => { - aliasQuery(req, 'ChainId', { - statistics: { __typename: 'Statistics', chainId: 'test-chain-id' }, - }); + aliasQuery(req, 'ChainId', generateChainId()); }); cy.mockGQLSubscription(); cy.get('main[data-testid="portfolio"]').should('exist'); diff --git a/apps/trading-e2e/src/integration/withdraw.cy.ts b/apps/trading-e2e/src/integration/withdraw.cy.ts index 613a8192b..7deb4a17a 100644 --- a/apps/trading-e2e/src/integration/withdraw.cy.ts +++ b/apps/trading-e2e/src/integration/withdraw.cy.ts @@ -1,6 +1,7 @@ import { aliasQuery } from '@vegaprotocol/cypress'; import { connectEthereumWallet } from '../support/ethereum-wallet'; import { generateAccounts } from '../support/mocks/generate-accounts'; +import { generateChainId } from '../support/mocks/generate-chain-id'; import { generateNetworkParameters } from '../support/mocks/generate-network-parameters'; import { generateWithdrawFormQuery } from '../support/mocks/generate-withdraw-page-query'; import { generateWithdrawals } from '../support/mocks/generate-withdrawals'; @@ -14,10 +15,13 @@ describe('withdraw', { tags: '@smoke' }, () => { const useMaximumAmount = 'use-maximum'; const submitWithdrawBtn = 'submit-withdrawal'; const ethAddressValue = Cypress.env('ETHEREUM_WALLET_ADDRESS'); + const asset1Name = 'Sepolia tBTC'; + const asset2Name = 'Sepolia tUSDC'; beforeEach(() => { cy.mockWeb3Provider(); cy.mockGQL((req) => { + aliasQuery(req, 'ChainId', generateChainId()); aliasQuery(req, 'Withdrawals', generateWithdrawals()); aliasQuery(req, 'NetworkParamsQuery', generateNetworkParameters()); aliasQuery(req, 'WithdrawFormQuery', generateWithdrawFormQuery()); @@ -34,9 +38,6 @@ describe('withdraw', { tags: '@smoke' }, () => { // It also requires connection Ethereum wallet connectEthereumWallet(); - cy.mockGQL((req) => { - aliasQuery(req, 'WithdrawFormQuery', generateWithdrawFormQuery()); - }); cy.getByTestId('withdraw-dialog-button').click(); cy.wait('@WithdrawFormQuery'); }); @@ -52,7 +53,7 @@ describe('withdraw', { tags: '@smoke' }, () => { cy.get(toAddressField).should('have.value', ethAddressValue); }); it('min amount', () => { - cy.get(assetSelectField).select('Asset 0'); // Select asset so we have a min viable amount calculated + cy.get(assetSelectField).select(asset1Name); // Select asset so we have a min viable amount calculated cy.get(amountField).clear().type('0'); cy.getByTestId(submitWithdrawBtn).click(); cy.get('[data-testid="input-error-text"]').should( @@ -61,7 +62,7 @@ describe('withdraw', { tags: '@smoke' }, () => { ); }); it('max amount', () => { - cy.get(assetSelectField).select('Asset 1'); // Will be above maximum because the vega wallet doesnt have any collateral + cy.get(assetSelectField).select(asset2Name); // Will be above maximum because the vega wallet doesnt have any collateral cy.get(amountField).clear().type('1'); cy.getByTestId(submitWithdrawBtn).click(); cy.get('[data-testid="input-error-text"]').should( @@ -71,7 +72,7 @@ describe('withdraw', { tags: '@smoke' }, () => { }); it('can set amount using use maximum button', () => { - cy.get(assetSelectField).select('Asset 0'); + cy.get(assetSelectField).select(asset1Name); cy.getByTestId(useMaximumAmount).click(); cy.get(amountField).should('have.value', '1000.00000'); }); @@ -86,7 +87,7 @@ describe('withdraw', { tags: '@smoke' }, () => { }, }, }); - cy.get(assetSelectField).select('Asset 0'); + cy.get(assetSelectField).select(asset1Name); cy.getByTestId('balance-available') .should('contain.text', 'Balance available') .find('td') diff --git a/apps/trading-e2e/src/support/index.js b/apps/trading-e2e/src/support/index.js index 219c9014f..8799c2317 100644 --- a/apps/trading-e2e/src/support/index.js +++ b/apps/trading-e2e/src/support/index.js @@ -2,13 +2,12 @@ import '@vegaprotocol/cypress'; import 'cypress-real-events/support'; import registerCypressGrep from 'cypress-grep'; import { aliasQuery } from '@vegaprotocol/cypress'; +import { generateChainId } from './mocks/generate-chain-id'; registerCypressGrep(); -beforeEach(() => { +before(() => { // Mock chainId fetch which happens on every page for wallet connection cy.mockGQL((req) => { - aliasQuery(req, 'ChainId', { - statistics: { __typename: 'Statistics', chainId: 'test-chain-id' }, - }); + aliasQuery(req, 'ChainId', generateChainId()); }); }); diff --git a/apps/trading-e2e/src/support/mocks/generate-chain-id.ts b/apps/trading-e2e/src/support/mocks/generate-chain-id.ts new file mode 100644 index 000000000..5ed5794d6 --- /dev/null +++ b/apps/trading-e2e/src/support/mocks/generate-chain-id.ts @@ -0,0 +1,16 @@ +import type { ChainIdQuery } from '@vegaprotocol/react-helpers'; +import merge from 'lodash/merge'; +import type { PartialDeep } from 'type-fest'; + +export const generateChainId = ( + override?: PartialDeep +): ChainIdQuery => { + const defaultResult = { + statistics: { + __typename: 'Statistics', + chainId: 'test-chain-id', + }, + }; + + return merge(defaultResult, override); +}; diff --git a/apps/trading-e2e/src/support/mocks/generate-network-parameters.ts b/apps/trading-e2e/src/support/mocks/generate-network-parameters.ts index 24076245e..4ca302030 100644 --- a/apps/trading-e2e/src/support/mocks/generate-network-parameters.ts +++ b/apps/trading-e2e/src/support/mocks/generate-network-parameters.ts @@ -14,18 +14,18 @@ export const generateNetworkParameters = ( network_id: '3', chain_id: '3', collateral_bridge_contract: { - address: '0x947893AaA0A7b55f66990b3B4781514b691Fdd4a', + address: '0x7fe27d970bc8Afc3B11Cc8d9737bfB66B1efd799', }, multisig_control_contract: { - address: '0xaE15126d2d1fAbF7cfA7cAD3cbD4921DfC87F620', + address: '0x6eBc32d66277D94DB8FF2ccF86E36f37F29a52D3', deployment_block_height: 12341882, }, staking_bridge_contract: { - address: '0x7896C9491962D5839783CB6e0492ECebd34Bb35F', + address: '0xFFb0A0d4806502ceF491aF1141f66669A1Bd0D03', deployment_block_height: 11177313, }, token_vesting_contract: { - address: '0x9F10cBeEf03A564Fb914c2010c0Cd55E9BB11406', + address: '0x680fF88252FA7071CAce7398e77872d54D781d0B', deployment_block_height: 11177353, }, confirmations: 3, diff --git a/apps/trading-e2e/src/support/mocks/generate-withdraw-page-query.ts b/apps/trading-e2e/src/support/mocks/generate-withdraw-page-query.ts index 01c57a4cf..610f6f2ca 100644 --- a/apps/trading-e2e/src/support/mocks/generate-withdraw-page-query.ts +++ b/apps/trading-e2e/src/support/mocks/generate-withdraw-page-query.ts @@ -16,26 +16,20 @@ export const generateWithdrawFormQuery = ( txHash: null, __typename: 'Withdrawal', }; - const account: WithdrawFormQuery_party_accounts = { - type: AccountType.ACCOUNT_TYPE_GENERAL, - balance: '100000000', - asset: { - __typename: 'Asset', - id: 'asset-0', - symbol: 'AST0', - }, - __typename: 'Account', - }; + + // NOTE: These assets ids and contract addresses are real assets on Sepolia, this is needed + // because we don't currently mock our seplia infura provider. If we change network these will + // need to be updated const assetEdge1: WithdrawFormQuery_assetsConnection_edges = { node: { - id: 'asset-0', - symbol: 'AST0', - name: 'Asset 0', + id: 'cee709223217281d7893b650850ae8ee8a18b7539b5658f9b4cc24de95dd18ad', + symbol: 'tBTC', + name: 'Sepolia tBTC', decimals: 5, status: AssetStatus.STATUS_ENABLED, source: { __typename: 'ERC20', - contractAddress: '0x5E4b9aDA947130Fc320a144cd22bC1641e5c9d81', + contractAddress: '0x1d525fB145Af5c51766a89706C09fE07E6058D1D', }, __typename: 'Asset', }, @@ -43,9 +37,9 @@ export const generateWithdrawFormQuery = ( }; const assetEdge2: WithdrawFormQuery_assetsConnection_edges = { node: { - id: 'asset-1', - symbol: 'AST1', - name: 'Asset 1', + id: 'c9fe6fc24fce121b2cc72680543a886055abb560043fda394ba5376203b7527d', + symbol: 'tUSDC', + name: 'Sepolia tUSDC', decimals: 5, status: AssetStatus.STATUS_ENABLED, source: { @@ -56,6 +50,17 @@ export const generateWithdrawFormQuery = ( }, __typename: 'AssetEdge', }; + const account: WithdrawFormQuery_party_accounts = { + type: AccountType.ACCOUNT_TYPE_GENERAL, + balance: '100000000', + asset: { + __typename: 'Asset', + id: assetEdge1.node.id, + symbol: 'AST0', + }, + __typename: 'Account', + }; + const defaultResult = { party: { id: 'party-0', @@ -68,6 +73,5 @@ export const generateWithdrawFormQuery = ( edges: [assetEdge1, assetEdge2], }, }; - return merge(defaultResult, override); }; diff --git a/apps/trading/.env b/apps/trading/.env index e011afe4f..ba6d15f3a 100644 --- a/apps/trading/.env +++ b/apps/trading/.env @@ -1,8 +1,8 @@ # App configuration variables NX_VEGA_ENV=TESTNET 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_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_VEGA_NETWORKS={\"MAINNET\":\"https://alpha.console.vega.xyz\"} NX_USE_ENV_OVERRIDES=1 NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf diff --git a/apps/trading/.env.devnet b/apps/trading/.env.devnet index b8d601848..395dd699d 100644 --- a/apps/trading/.env.devnet +++ b/apps/trading/.env.devnet @@ -3,7 +3,7 @@ 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_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_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_VEGA_EXPLORER_URL=https://dev.explorer.vega.xyz -NX_VEGA_TOKEN_URL=https://token.fairground.wtf \ No newline at end of file +NX_VEGA_TOKEN_URL=https://token.fairground.wtf diff --git a/apps/trading/.env.stagnet3 b/apps/trading/.env.stagnet3 index 353c8bfd9..70b891339 100644 --- a/apps/trading/.env.stagnet3 +++ b/apps/trading/.env.stagnet3 @@ -3,7 +3,7 @@ NX_VEGA_ENV=STAGNET3 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='{\"MAINNET\":\"https://alpha.console.vega.xyz\"}' -NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 -NX_ETHERSCAN_URL=https://ropsten.etherscan.io +NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_VEGA_EXPLORER_URL=https://staging3.explorer.vega.xyz -NX_VEGA_TOKEN_URL=https://token.fairground.wtf \ No newline at end of file +NX_VEGA_TOKEN_URL=https://token.fairground.wtf diff --git a/apps/trading/.env.testnet b/apps/trading/.env.testnet index 18e310fd9..24024c652 100644 --- a/apps/trading/.env.testnet +++ b/apps/trading/.env.testnet @@ -2,10 +2,10 @@ NX_VEGA_ENV=TESTNET NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql 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_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 +NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_USE_ENV_OVERRIDES=1 NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf NX_VEGA_TOKEN_URL=https://token.fairground.wtf NX_VEGA_WALLET_URL=http://localhost:1789 -NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz \ No newline at end of file +NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz diff --git a/libs/cypress/src/lib/eip1193-bridge.ts b/libs/cypress/src/lib/eip1193-bridge.ts index 31531fe46..621867f63 100644 --- a/libs/cypress/src/lib/eip1193-bridge.ts +++ b/libs/cypress/src/lib/eip1193-bridge.ts @@ -108,11 +108,11 @@ export class CustomizedBridge extends Eip1193Bridge { const getAccount = (number = 0) => `m/44'/60'/0'/0/${number}`; -const getProvider = () => - new JsonRpcProvider( - Cypress.env('ETHEREUM_PROVIDER_URL'), - Cypress.env('ETHEREUM_CHAIN_ID') - ); +const getProvider = () => { + const url = Cypress.env('ETHEREUM_PROVIDER_URL'); + const chainId = Cypress.env('ETHEREUM_CHAIN_ID'); + return new JsonRpcProvider(url, chainId); +}; export const createBridge = () => { const provider = getProvider(); diff --git a/libs/environment/src/hooks/use-environment.spec.tsx b/libs/environment/src/hooks/use-environment.spec.tsx index 822134a40..7c6c25732 100644 --- a/libs/environment/src/hooks/use-environment.spec.tsx +++ b/libs/environment/src/hooks/use-environment.spec.tsx @@ -189,9 +189,9 @@ it('when VEGA_NETWORKS is not a valid json, prints a warning and continues witho it.each` env | etherscanUrl | providerUrl - ${Networks.DEVNET} | ${'https://ropsten.etherscan.io'} | ${'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'} - ${Networks.TESTNET} | ${'https://ropsten.etherscan.io'} | ${'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'} - ${Networks.STAGNET3} | ${'https://ropsten.etherscan.io'} | ${'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'} + ${Networks.DEVNET} | ${'https://sepolia.etherscan.io'} | ${'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'} + ${Networks.TESTNET} | ${'https://sepolia.etherscan.io'} | ${'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'} + ${Networks.STAGNET3} | ${'https://sepolia.etherscan.io'} | ${'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'} ${Networks.MAINNET} | ${'https://etherscan.io'} | ${'https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'} `( 'uses correct default ethereum connection variables in $env', diff --git a/libs/environment/src/utils/compile-environment.ts b/libs/environment/src/utils/compile-environment.ts index 63b0d2ab3..1af366b77 100644 --- a/libs/environment/src/utils/compile-environment.ts +++ b/libs/environment/src/utils/compile-environment.ts @@ -12,13 +12,13 @@ const isBrowser = typeof window !== 'undefined'; const getDefaultEtherumProviderUrl = (env: Networks) => { return env === Networks.MAINNET ? 'https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8' - : 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'; + : 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'; }; const getDefaultEtherscanUrl = (env: Networks) => { return env === Networks.MAINNET ? 'https://etherscan.io' - : 'https://ropsten.etherscan.io'; + : 'https://sepolia.etherscan.io'; }; const transformValue = (key: EnvKey, value?: string) => { diff --git a/libs/fills/src/lib/fills-table.spec.tsx b/libs/fills/src/lib/fills-table.spec.tsx index 493959181..a8686b446 100644 --- a/libs/fills/src/lib/fills-table.spec.tsx +++ b/libs/fills/src/lib/fills-table.spec.tsx @@ -138,7 +138,6 @@ describe('FillsTable', () => { const amountCell = cells.find((c) => c.getAttribute('col-id') === 'size'); expect(amountCell).toHaveClass('text-vega-red-dark'); - screen.debug(); }); it('should render correct maker or taker role', async () => { diff --git a/libs/smart-contracts/src/contracts/claim.ts b/libs/smart-contracts/src/contracts/claim.ts index 45c8e502a..7a95621eb 100644 --- a/libs/smart-contracts/src/contracts/claim.ts +++ b/libs/smart-contracts/src/contracts/claim.ts @@ -9,11 +9,11 @@ export const SPENT_CODE = '0x0000000000000000000000000000000000000001'; * Example: * ``` * const provider = new Web3.providers.HttpProvider( - * "https://ropsten.infura.io/v3/5aff9e61ad844bcf982d0d0c3f1d29f1" + * "https://sepolia.infura.io/v3/5aff9e61ad844bcf982d0d0c3f1d29f1" * ); * const web3 = new Web3(provider) - * // Ropsten address + * // Sepolia address * const contract = new VegaClaim(web3, "0xAf5dC1772714b2F4fae3b65eb83100f1Ea677b21") * contract.isCountryBlocked("US").then(console.log) * contract.isClaimValid({ claimCode: "0x...", expiry: 0, nonce: "0x00", account: "0x00" }) diff --git a/scripts/get-tranches.js b/scripts/get-tranches.js index 138e3e224..04808d11a 100644 --- a/scripts/get-tranches.js +++ b/scripts/get-tranches.js @@ -15,19 +15,19 @@ const CONFIG = [ { env: 'testnet', contract: '0xe2deBB240b43EDfEBc9c38B67c0894B9A92Bf07c', - provider: 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8', + provider: 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8', startBlock: 11340808, }, { env: 'stagnet3', contract: '0x9F10cBeEf03A564Fb914c2010c0Cd55E9BB11406', - provider: 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8', + provider: 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8', startBlock: 11790009, }, { env: 'devnet', contract: '0xd1216AAb948f5FC706Df73df6d71c64CcaA8550a', - provider: 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8', + provider: 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8', startBlock: 11790003, }, ];