From 775228eee151180c95bf66720ff6ec7af88ada3f Mon Sep 17 00:00:00 2001 From: Vasyl Ivanchuk Date: Tue, 30 Jan 2024 15:03:36 +0200 Subject: [PATCH 1/8] fix: remove portal from header --- docker-compose-cli.yaml | 7 ++++--- docker-compose.yaml | 1 - packages/app/README.md | 2 -- packages/app/src/components/header/TheHeader.vue | 4 ---- .../components/transactions/infoTable/GeneralInfo.vue | 2 +- packages/app/src/composables/useRuntimeConfig.ts | 3 +-- packages/app/src/configs/dev.config.json | 11 +++-------- packages/app/src/configs/index.ts | 1 - packages/app/src/configs/local.config.json | 1 - packages/app/src/configs/production.config.json | 9 +++------ packages/app/src/configs/staging.config.json | 10 +++------- packages/app/src/locales/en.json | 1 - packages/app/src/locales/uk.json | 1 - packages/app/tests/components/TheHeader.spec.ts | 3 +-- packages/app/tests/mocks.ts | 2 -- 15 files changed, 16 insertions(+), 42 deletions(-) diff --git a/docker-compose-cli.yaml b/docker-compose-cli.yaml index c01ce5d059..a8f29e8478 100644 --- a/docker-compose-cli.yaml +++ b/docker-compose-cli.yaml @@ -1,6 +1,3 @@ -version: "3.2" -name: "zkcli-block-explorer" - services: app: platform: linux/amd64 @@ -26,6 +23,8 @@ services: - DATA_FETCHER_URL=http://data-fetcher:3040 - BATCHES_PROCESSING_POLLING_INTERVAL=1000 restart: unless-stopped + extra_hosts: + - "host.docker.internal:host-gateway" data-fetcher: platform: linux/amd64 @@ -38,6 +37,8 @@ services: ports: - '3040:3040' restart: unless-stopped + extra_hosts: + - "host.docker.internal:host-gateway" api: platform: linux/amd64 diff --git a/docker-compose.yaml b/docker-compose.yaml index 1020cc35bc..ac0610607d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,3 @@ -name: block-explorer services: app: build: diff --git a/packages/app/README.md b/packages/app/README.md index ab191f5bb0..692aeb3de6 100644 --- a/packages/app/README.md +++ b/packages/app/README.md @@ -46,7 +46,6 @@ const config: EnvironmentConfig = { icon: "/images/icons/zksync-arrows.svg", l2ChainId: 270, l2NetworkName: "Local", - l2WalletUrl: "https://goerli.staging-portal.zksync.dev/", maintenance: false, name: "local", published: true, @@ -60,7 +59,6 @@ const config: EnvironmentConfig = { icon: "/images/icons/zksync-arrows.svg", l2ChainId: 270, l2NetworkName: "Local Hyperchain", - l2WalletUrl: "https://goerli.staging-portal.zksync.dev/", maintenance: false, name: "local-hyperchain", published: true, diff --git a/packages/app/src/components/header/TheHeader.vue b/packages/app/src/components/header/TheHeader.vue index 2c7ca32a8e..dd75815f1d 100644 --- a/packages/app/src/components/header/TheHeader.vue +++ b/packages/app/src/components/header/TheHeader.vue @@ -191,10 +191,6 @@ const links = [ label: computed(() => t("header.nav.contractVerification")), to: { name: "contract-verification" }, }, - { - label: computed(() => t("header.nav.portal")), - url: computed(() => currentNetwork.value.l2WalletUrl), - }, ]; if (currentNetwork.value.bridgeUrl) { diff --git a/packages/app/src/components/transactions/infoTable/GeneralInfo.vue b/packages/app/src/components/transactions/infoTable/GeneralInfo.vue index f1b554ed4a..40fbb238d6 100644 --- a/packages/app/src/components/transactions/infoTable/GeneralInfo.vue +++ b/packages/app/src/components/transactions/infoTable/GeneralInfo.vue @@ -30,7 +30,7 @@ /> - + {{ t("transactions.table.reason") }} diff --git a/packages/app/src/composables/useRuntimeConfig.ts b/packages/app/src/composables/useRuntimeConfig.ts index b0a053ee8e..0e7e6dc32c 100644 --- a/packages/app/src/composables/useRuntimeConfig.ts +++ b/packages/app/src/composables/useRuntimeConfig.ts @@ -3,13 +3,12 @@ import type { NetworkConfig, RuntimeConfig } from "@/configs"; export const DEFAULT_NETWORK: NetworkConfig = { apiUrl: "https://block-explorer-api.testnets.zksync.dev", verificationApiUrl: "https://zksync2-testnet-explorer.zksync.dev", - bridgeUrl: "https://goerli.bridge.zksync.io", + bridgeUrl: "https://portal.zksync.io/bridge/?network=goerli", hostnames: ["https://goerli.explorer.zksync.io"], icon: "/images/icons/zksync-arrows.svg", l1ExplorerUrl: "https://goerli.etherscan.io", l2ChainId: 280, l2NetworkName: "zkSync Era Goerli Testnet", - l2WalletUrl: "https://goerli.portal.zksync.io/", maintenance: false, name: "goerli", published: true, diff --git a/packages/app/src/configs/dev.config.json b/packages/app/src/configs/dev.config.json index 07de06fbd1..ceca3f98f7 100644 --- a/packages/app/src/configs/dev.config.json +++ b/packages/app/src/configs/dev.config.json @@ -9,7 +9,6 @@ "icon": "/images/icons/zksync-arrows.svg", "l2ChainId": 270, "l2NetworkName": "Local", - "l2WalletUrl": "http://localhost:3000", "maintenance": false, "name": "local", "published": true, @@ -18,7 +17,7 @@ { "apiUrl": "https://block-explorer-api.testnets.zksync.dev", "verificationApiUrl": "https://zksync2-testnet-explorer.zksync.dev", - "bridgeUrl": "https://staging.goerli.bridge.zksync.dev", + "bridgeUrl": "https://portal.zksync.io/bridge/?network=goerli", "hostnames": [ "https://goerli.staging-scan-v2.zksync.dev" ], @@ -26,7 +25,6 @@ "l1ExplorerUrl": "https://goerli.etherscan.io", "l2ChainId": 280, "l2NetworkName": "zkSync Era Goerli Testnet", - "l2WalletUrl": "https://goerli.staging-portal.zksync.dev/", "maintenance": false, "name": "goerli", "published": true, @@ -35,13 +33,12 @@ { "apiUrl": "https://block-explorer-api.sepolia.zksync.dev", "verificationApiUrl": "https://explorer.sepolia.era.zksync.dev", - "bridgeUrl": "https://staging.goerli.bridge.zksync.dev", + "bridgeUrl": "https://portal.zksync.io/bridge/?network=sepolia", "hostnames": [], "icon": "/images/icons/zksync-arrows.svg", "l1ExplorerUrl": "https://sepolia.etherscan.io", "l2ChainId": 300, "l2NetworkName": "zkSync Era Sepolia Testnet", - "l2WalletUrl": "https://staging-portal.zksync.dev/?network=era-boojnet", "maintenance": false, "name": "sepolia", "published": true, @@ -57,7 +54,6 @@ "l1ExplorerUrl": "https://goerli.etherscan.io", "l2ChainId": 270, "l2NetworkName": "Goerli (Stage2)", - "l2WalletUrl": "https://goerli-beta.staging-portal.zksync.dev/", "maintenance": false, "name": "goerli-beta", "published": true, @@ -66,7 +62,7 @@ { "apiUrl": "https://block-explorer-api.mainnet.zksync.io", "verificationApiUrl": "https://zksync2-mainnet-explorer.zksync.io", - "bridgeUrl": "https://staging.bridge.zksync.dev", + "bridgeUrl": "https://portal.zksync.io/bridge/?network=mainnet", "hostnames": [ "https://staging-scan-v2.zksync.dev" ], @@ -74,7 +70,6 @@ "l1ExplorerUrl": "https://etherscan.io", "l2ChainId": 324, "l2NetworkName": "zkSync Era Mainnet", - "l2WalletUrl": "https://staging-portal.zksync.dev/", "maintenance": false, "name": "mainnet", "published": true, diff --git a/packages/app/src/configs/index.ts b/packages/app/src/configs/index.ts index edee2ceeae..22b59f9657 100644 --- a/packages/app/src/configs/index.ts +++ b/packages/app/src/configs/index.ts @@ -6,7 +6,6 @@ export type NetworkConfig = { rpcUrl: string; bridgeUrl?: string; l2NetworkName: string; - l2WalletUrl: string; l2ChainId: 270 | 280 | 324; l1ExplorerUrl?: string; maintenance: boolean; diff --git a/packages/app/src/configs/local.config.json b/packages/app/src/configs/local.config.json index afd0e82298..cbaee29f8a 100644 --- a/packages/app/src/configs/local.config.json +++ b/packages/app/src/configs/local.config.json @@ -9,7 +9,6 @@ "icon": "/images/icons/zksync-arrows.svg", "l2ChainId": 270, "l2NetworkName": "Local", - "l2WalletUrl": "http://localhost:3000", "maintenance": false, "name": "local", "published": true, diff --git a/packages/app/src/configs/production.config.json b/packages/app/src/configs/production.config.json index d2a5f9eab7..066884be9c 100644 --- a/packages/app/src/configs/production.config.json +++ b/packages/app/src/configs/production.config.json @@ -3,7 +3,7 @@ { "apiUrl": "https://block-explorer-api.testnets.zksync.dev", "verificationApiUrl": "https://zksync2-testnet-explorer.zksync.dev", - "bridgeUrl": "https://goerli.bridge.zksync.io", + "bridgeUrl": "https://portal.zksync.io/bridge/?network=goerli", "hostnames": [ "https://goerli.explorer.zksync.io" ], @@ -11,7 +11,6 @@ "l1ExplorerUrl": "https://goerli.etherscan.io", "l2ChainId": 280, "l2NetworkName": "zkSync Era Goerli Testnet", - "l2WalletUrl": "https://goerli.portal.zksync.io/", "maintenance": false, "name": "goerli", "published": true, @@ -20,7 +19,7 @@ { "apiUrl": "https://block-explorer-api.sepolia.zksync.dev", "verificationApiUrl": "https://explorer.sepolia.era.zksync.dev", - "bridgeUrl": "https://bridge.zksync.io", + "bridgeUrl": "https://portal.zksync.io/bridge/?network=sepolia", "hostnames": [ "https://sepolia.explorer.zksync.io" ], @@ -28,7 +27,6 @@ "l1ExplorerUrl": "https://sepolia.etherscan.io", "l2ChainId": 300, "l2NetworkName": "zkSync Era Sepolia Testnet", - "l2WalletUrl": "https://portal.zksync.io/", "maintenance": false, "name": "sepolia", "published": true, @@ -37,7 +35,7 @@ { "apiUrl": "https://block-explorer-api.mainnet.zksync.io", "verificationApiUrl": "https://zksync2-mainnet-explorer.zksync.io", - "bridgeUrl": "https://bridge.zksync.io", + "bridgeUrl": "https://portal.zksync.io/bridge/?network=mainnet", "hostnames": [ "https://explorer.zksync.io" ], @@ -45,7 +43,6 @@ "l1ExplorerUrl": "https://etherscan.io", "l2ChainId": 324, "l2NetworkName": "zkSync Era Mainnet", - "l2WalletUrl": "https://portal.zksync.io/", "maintenance": false, "name": "mainnet", "published": true, diff --git a/packages/app/src/configs/staging.config.json b/packages/app/src/configs/staging.config.json index fe9e8d4c27..fd3818f4b2 100644 --- a/packages/app/src/configs/staging.config.json +++ b/packages/app/src/configs/staging.config.json @@ -3,7 +3,7 @@ { "apiUrl": "https://block-explorer-api.testnets.zksync.dev", "verificationApiUrl": "https://zksync2-testnet-explorer.zksync.dev", - "bridgeUrl": "https://staging.goerli.bridge.zksync.dev", + "bridgeUrl": "https://portal.zksync.io/bridge/?network=goerli", "hostnames": [ "https://goerli.staging-scan-v2.zksync.dev" ], @@ -11,7 +11,6 @@ "l1ExplorerUrl": "https://goerli.etherscan.io", "l2ChainId": 280, "l2NetworkName": "zkSync Era Goerli Testnet", - "l2WalletUrl": "https://goerli.staging-portal.zksync.dev/", "maintenance": false, "name": "goerli", "published": true, @@ -20,7 +19,7 @@ { "apiUrl": "https://block-explorer-api.sepolia.zksync.dev", "verificationApiUrl": "https://explorer.sepolia.era.zksync.dev", - "bridgeUrl": "https://staging.goerli.bridge.zksync.dev", + "bridgeUrl": "https://portal.zksync.io/bridge/?network=sepolia", "hostnames": [ "https://sepolia.staging-scan-v2.zksync.dev" ], @@ -28,7 +27,6 @@ "l1ExplorerUrl": "https://sepolia.etherscan.io", "l2ChainId": 300, "l2NetworkName": "zkSync Era Sepolia Testnet", - "l2WalletUrl": "https://staging-portal.zksync.dev/?network=era-boojnet", "maintenance": false, "name": "sepolia", "published": true, @@ -44,7 +42,6 @@ "l1ExplorerUrl": "https://goerli.etherscan.io", "l2ChainId": 270, "l2NetworkName": "Goerli (Stage2)", - "l2WalletUrl": "https://goerli-beta.staging-portal.zksync.dev/", "maintenance": false, "name": "goerli-beta", "published": true, @@ -53,7 +50,7 @@ { "apiUrl": "https://block-explorer-api.mainnet.zksync.io", "verificationApiUrl": "https://zksync2-mainnet-explorer.zksync.io", - "bridgeUrl": "https://staging.bridge.zksync.dev", + "bridgeUrl": "https://portal.zksync.io/bridge/?network=mainnet", "hostnames": [ "https://staging-scan-v2.zksync.dev" ], @@ -61,7 +58,6 @@ "l1ExplorerUrl": "https://etherscan.io", "l2ChainId": 324, "l2NetworkName": "zkSync Era Mainnet", - "l2WalletUrl": "https://staging-portal.zksync.dev/", "maintenance": false, "name": "mainnet", "published": true, diff --git a/packages/app/src/locales/en.json b/packages/app/src/locales/en.json index 662856dcc6..ee0c84942a 100644 --- a/packages/app/src/locales/en.json +++ b/packages/app/src/locales/en.json @@ -281,7 +281,6 @@ "header": { "nav": { "blockExplorer": "Block Explorer", - "portal": "Portal", "documentation": "Documentation", "tools": "Tools", "apiDocs": "API Documentation", diff --git a/packages/app/src/locales/uk.json b/packages/app/src/locales/uk.json index b37af6f27c..c8b946f0fa 100644 --- a/packages/app/src/locales/uk.json +++ b/packages/app/src/locales/uk.json @@ -152,7 +152,6 @@ "contractVerification": "Верифікація Смарт контракту", "debugger": "zkEVM Налагоджувач", "blockExplorer": "Провідник", - "portal": "Портал", "documentation": "Документація" } }, diff --git a/packages/app/tests/components/TheHeader.spec.ts b/packages/app/tests/components/TheHeader.spec.ts index c409a6cfd1..a5367a5832 100644 --- a/packages/app/tests/components/TheHeader.spec.ts +++ b/packages/app/tests/components/TheHeader.spec.ts @@ -23,7 +23,6 @@ vi.mock("@/composables/useContext", () => { default: () => ({ currentNetwork: computed(() => ({ maintenance: maintenanceMock(), - l2WalletUrl: "https://portal.zksync.io/", bridgeUrl: "https://bridge.zksync.io/", apiUrl: "https://api-url", })), @@ -60,7 +59,7 @@ describe("TheHeader:", () => { const toolsLinks = dropdown[1].findAll("a"); expect(toolsLinks[0].attributes("href")).toBe("https://api-url/docs"); expect(toolsLinksRouter[0].props().to.name).toBe("contract-verification"); - expect(toolsLinks[2].attributes("href")).toBe("https://portal.zksync.io/"); + expect(toolsLinks[2].attributes("href")).toBe("https://bridge.zksync.io/"); expect(wrapper.findAll(".navigation-container > .navigation-link")[0].attributes("href")).toBe( "https://docs.zksync.io/build/tooling/block-explorer/getting-started.html" diff --git a/packages/app/tests/mocks.ts b/packages/app/tests/mocks.ts index 33dd3858dd..2e92981dba 100644 --- a/packages/app/tests/mocks.ts +++ b/packages/app/tests/mocks.ts @@ -42,7 +42,6 @@ export const GOERLI_NETWORK: NetworkConfig = { l2ChainId: 280, rpcUrl: "", l2NetworkName: "Goerli", - l2WalletUrl: "", l1ExplorerUrl: "http://goerli-block-explorer", maintenance: false, published: true, @@ -56,7 +55,6 @@ export const GOERLI_BETA_NETWORK: NetworkConfig = { l2ChainId: 270, rpcUrl: "", l2NetworkName: "Goerli Beta", - l2WalletUrl: "", l1ExplorerUrl: "http://goerli-beta-block-explorer", maintenance: false, published: true, From 0a35dcb33f7207e6429fa66f939642a6cd871ab6 Mon Sep 17 00:00:00 2001 From: Vasyl Ivanchuk Date: Tue, 30 Jan 2024 16:01:03 +0200 Subject: [PATCH 2/8] test: comment e2e tests for Portal links --- README.md | 2 +- .../tests/e2e/features/artifacts/artifactsSet1.feature | 8 ++++---- .../e2e/features/redirection/redirectionSet1.feature | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3cdd7e3dd5..72ef1ab58b 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Each component can also be started individually. Follow individual packages `REA ## 🐳 Running in Docker There is a docker compose configuration that allows you to run Block Explorer and all its dependencies in docker. Just run the following command to spin up the whole environment: ``` -docker-compose up +docker compose up ``` It will run local Ethereum node, ZkSync Era, Postgres DB and all Block Explorer services. diff --git a/packages/app/tests/e2e/features/artifacts/artifactsSet1.feature b/packages/app/tests/e2e/features/artifacts/artifactsSet1.feature index 4b1cb560f2..80d81ff0ca 100644 --- a/packages/app/tests/e2e/features/artifacts/artifactsSet1.feature +++ b/packages/app/tests/e2e/features/artifacts/artifactsSet1.feature @@ -14,7 +14,7 @@ Feature: Main Page Examples: | Sub-Section | url | | Smart Contract Verification | /contracts/verify | - | Portal | https://goerli.staging-portal.zksync.dev/ | + #| Portal | https://goerli.staging-portal.zksync.dev/ | @id253 @featureEnv @mainnet Scenario Outline: Check the element "" in Tools section is available, clickable and have correct href @@ -26,7 +26,7 @@ Feature: Main Page Examples: | Sub-Section | url | | Smart Contract Verification | /contracts/verify | - | Portal | https://staging-portal.zksync.dev/ | + #| Portal | https://staging-portal.zksync.dev/ | @id253:I @productionEnv @testnet Scenario Outline: Check the element "" in Tools section is available, clickable and have correct href @@ -38,7 +38,7 @@ Feature: Main Page Examples: | Sub-Section | url | | Smart Contract Verification | /contracts/verify | - | Portal | https://goerli.portal.zksync.io/ | + #| Portal | https://goerli.portal.zksync.io/ | @id253:I @productionEnv @mainnet Scenario Outline: Check the element "" in Tools section is available, clickable and have correct href @@ -50,7 +50,7 @@ Feature: Main Page Examples: | Sub-Section | url | | Smart Contract Verification | /contracts/verify | - | Portal | https://portal.zksync.io/ | + #| Portal | https://portal.zksync.io/ | @id231 Scenario Outline: Check social networks icon "" is available, clickable and have correct href diff --git a/packages/app/tests/e2e/features/redirection/redirectionSet1.feature b/packages/app/tests/e2e/features/redirection/redirectionSet1.feature index 70698f7185..fc10256fbe 100644 --- a/packages/app/tests/e2e/features/redirection/redirectionSet1.feature +++ b/packages/app/tests/e2e/features/redirection/redirectionSet1.feature @@ -64,7 +64,7 @@ Feature: Redirection Examples: | Sub-Section | url | - | Portal | https://goerli.staging-portal.zksync.dev/ | + #| Portal | https://goerli.staging-portal.zksync.dev/ | @id253:IIII @productionEnv @testnet @@ -75,7 +75,7 @@ Feature: Redirection Examples: | Sub-Section | url | redirect_url | - | Portal | https://zksync.io/explore#bridges | https://goerli.portal.zksync.io | + #| Portal | https://zksync.io/explore#bridges | https://goerli.portal.zksync.io | @id253:IV @featureEnv @mainnet Scenario Outline: Verify redirection for "" in Tools menu @@ -85,7 +85,7 @@ Feature: Redirection Examples: | Sub-Section | url | - | Portal | https://staging-portal.zksync.dev/ | + #| Portal | https://staging-portal.zksync.dev/ | @id253:IV @productionEnv @mainnet @@ -96,7 +96,7 @@ Feature: Redirection Examples: | Sub-Section | url | redirect_url | - | Portal | https://zksync.io/explore#bridges | https://portal.zksync.io | + #| Portal | https://zksync.io/explore#bridges | https://portal.zksync.io | #Account page @id259 @testnet From 576dcc3fc37f6298c0f7d5a9666fb41daba08327 Mon Sep 17 00:00:00 2001 From: Vasyl Ivanchuk Date: Tue, 30 Jan 2024 20:37:02 +0200 Subject: [PATCH 3/8] fix: run prod mode in docker compose --- .dockerignore | 3 ++- docker-compose.yaml | 29 ----------------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/.dockerignore b/.dockerignore index 20b25939ec..f05f8a34ae 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ -**/dist/ \ No newline at end of file +**/dist/ +**.env \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index ac0610607d..e084d9afa6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,13 +3,8 @@ services: build: context: . dockerfile: ./packages/app/Dockerfile - target: development-stage - command: npm run --prefix packages/app dev -- --host ports: - '3010:3010' - volumes: - - ./packages/app:/usr/src/app/packages/app - - /usr/src/app/packages/app/node_modules depends_on: - api restart: unless-stopped @@ -18,12 +13,9 @@ services: build: context: . dockerfile: ./packages/worker/Dockerfile - target: development-stage - command: npm run --prefix packages/worker dev:debug environment: - PORT=3001 - LOG_LEVEL=verbose - - NODE_ENV=development - DATABASE_HOST=postgres - DATABASE_USER=postgres - DATABASE_PASSWORD=postgres @@ -33,11 +25,6 @@ services: - BATCHES_PROCESSING_POLLING_INTERVAL=1000 ports: - '3001:3001' - - '9229:9229' - - '9230:9230' - volumes: - - ./packages/worker:/usr/src/app/packages/worker - - /usr/src/app/packages/worker/node_modules depends_on: zksync: condition: service_healthy @@ -47,20 +34,12 @@ services: build: context: . dockerfile: ./packages/data-fetcher/Dockerfile - target: development-stage - command: npm run --prefix packages/data-fetcher dev:debug environment: - PORT=3040 - LOG_LEVEL=verbose - - NODE_ENV=development - BLOCKCHAIN_RPC_URL=http://zksync:3050 ports: - '3040:3040' - - '9231:9229' - - '9232:9230' - volumes: - - ./packages/data-fetcher:/usr/src/app/packages/data-fetcher - - /usr/src/app/packages/data-fetcher/node_modules depends_on: zksync: condition: service_healthy @@ -70,22 +49,14 @@ services: build: context: . dockerfile: ./packages/api/Dockerfile - target: development-stage - command: npm run --prefix packages/api dev:debug environment: - PORT=3020 - METRICS_PORT=3005 - LOG_LEVEL=verbose - - NODE_ENV=development - DATABASE_URL=postgres://postgres:postgres@postgres:5432/block-explorer ports: - '3020:3020' - '3005:3005' - - '9233:9229' - - '9234:9230' - volumes: - - ./packages/api:/usr/src/app/packages/api - - /usr/src/app/packages/api/node_modules depends_on: - worker restart: unless-stopped From f31ea0add1b876e5f34e0b46167ebfbdb3a5b05a Mon Sep 17 00:00:00 2001 From: Vasyl Ivanchuk Date: Tue, 30 Jan 2024 21:11:39 +0200 Subject: [PATCH 4/8] fix: increase the number of zksync container health retries --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index e084d9afa6..55e1999cbf 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -113,7 +113,7 @@ services: test: "curl -H \"Content-Type: application/json\" -X POST --data '{\"jsonrpc\":\"2.0\",\"method\":\"web3_clientVersion\",\"params\":[],\"id\":67}' 127.0.0.1:3050 || exit 1" interval: 5s timeout: 5s - retries: 120 + retries: 300 restart: unless-stopped volumes: From 66c017867f0fe39ec041dacb58cfb91e637edfb4 Mon Sep 17 00:00:00 2001 From: Oleh Bairak <118197764+olehbairak@users.noreply.github.com> Date: Fri, 2 Feb 2024 12:00:35 +0100 Subject: [PATCH 5/8] fix: update tests for removing duplicate portal links (#160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What ❔ In the scope of this PR several changes to automation tests were performed. Based on the [PR](https://github.com/matter-labs/block-explorer/pull/159). Where Portal links were removed and replaced with one solid approach - to display link to Bridge as unified platform that we currently use. ## Why ❔ To have automation tests coverage up-to-date with recent changes and not to block ci/cd run with incorrect behavior for old link. ## Checklist - [ +] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ +] Tests for the changes have been added / updated. - [ -] Documentation comments have been added / updated. --- .../features/artifacts/artifactsSet1.feature | 49 +++++-------------- .../redirection/redirectionSet1.feature | 36 +++----------- 2 files changed, 20 insertions(+), 65 deletions(-) diff --git a/packages/app/tests/e2e/features/artifacts/artifactsSet1.feature b/packages/app/tests/e2e/features/artifacts/artifactsSet1.feature index 80d81ff0ca..f985c01e6b 100644 --- a/packages/app/tests/e2e/features/artifacts/artifactsSet1.feature +++ b/packages/app/tests/e2e/features/artifacts/artifactsSet1.feature @@ -4,53 +4,30 @@ Feature: Main Page Background: Given I am on main page - @id253 @featureEnv @testnet - Scenario Outline: Check the element "" in Tools section is available, clickable and have correct href - Given I click by text "Tools" - Given Element with "text" "" should be "visible" - When Element with "text" "" should be "clickable" - Then Element with "text" "" should have "" value - - Examples: - | Sub-Section | url | - | Smart Contract Verification | /contracts/verify | - #| Portal | https://goerli.staging-portal.zksync.dev/ | - - @id253 @featureEnv @mainnet - Scenario Outline: Check the element "" in Tools section is available, clickable and have correct href - Given I click by text "Tools" - Given Element with "text" "" should be "visible" - When Element with "text" "" should be "clickable" - Then Element with "text" "" should have "" value - Examples: - | Sub-Section | url | - | Smart Contract Verification | /contracts/verify | - #| Portal | https://staging-portal.zksync.dev/ | - - @id253:I @productionEnv @testnet - Scenario Outline: Check the element "" in Tools section is available, clickable and have correct href + @id253:I @featureEnv @testnetSmokeSuite @testnet + Scenario Outline: Check the element "" in Tools section is available, clickable and have correct href (Sepolia) Given I click by text "Tools" Given Element with "text" "" should be "visible" When Element with "text" "" should be "clickable" Then Element with "text" "" should have "" value Examples: - | Sub-Section | url | - | Smart Contract Verification | /contracts/verify | - #| Portal | https://goerli.portal.zksync.io/ | + | Sub-Section | url | + | Smart Contract Verification | /contracts/verify | + | Bridge | https://portal.zksync.io/bridge/?network=sepolia | - @id253:I @productionEnv @mainnet - Scenario Outline: Check the element "" in Tools section is available, clickable and have correct href + @id253:II @mainnet + Scenario Outline: Check the element "" in Tools section is available, clickable and have correct href (Mainnet) Given I click by text "Tools" Given Element with "text" "" should be "visible" When Element with "text" "" should be "clickable" Then Element with "text" "" should have "" value Examples: - | Sub-Section | url | - | Smart Contract Verification | /contracts/verify | - #| Portal | https://portal.zksync.io/ | + | Sub-Section | url | + | Smart Contract Verification | /contracts/verify | + | Bridge | https://portal.zksync.io/bridge/?network=mainnet | @id231 Scenario Outline: Check social networks icon "" is available, clickable and have correct href @@ -85,7 +62,7 @@ Feature: Main Page | zkSync Era Sepolia Testnet | network | | zkSync Era Goerli Testnet | network | | Goerli (Stage2) | network | - + @id254:II @productionEnv Scenario Outline: Check dropdown "" for "" and verify Given Set the "" value for "" switcher @@ -139,7 +116,7 @@ Feature: Main Page Given I go to page "/address/0x8f0F33583a56908F7F933cd6F0AaE382aC3fd8f6" Then Element with "id" "search" should be "visible" - @id209:I @testnet + @id209:I @testnet Scenario Outline: Verify Transaction table contains "" row Given I go to page "/tx/0xe7a91cc9b270d062328ef995e0ef67195a3703d43ce4e1d375f87d5c64e51981" When Table contains row with "" @@ -201,7 +178,7 @@ Feature: Main Page | Created | 2023-05-14 | - @id211 @testnet + @id211 @testnet Scenario Outline: Verify Contract info table contains "" row Given I go to page "/address/0x3e7676937A7E96CFB7616f255b9AD9FF47363D4b" Then Element with "text" "" should be "visible" diff --git a/packages/app/tests/e2e/features/redirection/redirectionSet1.feature b/packages/app/tests/e2e/features/redirection/redirectionSet1.feature index fc10256fbe..468f71feab 100644 --- a/packages/app/tests/e2e/features/redirection/redirectionSet1.feature +++ b/packages/app/tests/e2e/features/redirection/redirectionSet1.feature @@ -45,7 +45,7 @@ Feature: Redirection | Blocks | /blocks/ | | Transactions | /transactions/ | - @id253:II + @id253:I Scenario Outline: Verify redirection for "" in Tools menu Given I click by text "Tools " When I click by element with partial href "" and text "" @@ -56,26 +56,15 @@ Feature: Redirection | Smart Contract Verification | /contracts/verify | # | zkEVM Debugger | /tools/debugger | - @id253:III @featureEnv @testnet - Scenario Outline: Verify redirection for "" in Tools menu - Given I click by text "Tools " - When I click by element with partial href "" and text "" - Then New page have "" address - - Examples: - | Sub-Section | url | - #| Portal | https://goerli.staging-portal.zksync.dev/ | - - - @id253:IIII @productionEnv @testnet - Scenario Outline: Verify redirection for "" in Tools menu + @id253:III @featureEnv @testnetSmokeSuite @testnet + Scenario Outline: Verify redirection for "" in Tools menu (Sepolia) Given I click by text "Tools " When I click by element with partial href "" and text "" Then New page have "" address Examples: - | Sub-Section | url | redirect_url | - #| Portal | https://zksync.io/explore#bridges | https://goerli.portal.zksync.io | + | Sub-Section | url | redirect_url | + | Bridge | https://portal.zksync.io/bridge/?network=sepolia | https://portal.zksync.io/bridge/?network=sepolia | @id253:IV @featureEnv @mainnet Scenario Outline: Verify redirection for "" in Tools menu @@ -84,19 +73,8 @@ Feature: Redirection Then New page have "" address Examples: - | Sub-Section | url | - #| Portal | https://staging-portal.zksync.dev/ | - - - @id253:IV @productionEnv @mainnet - Scenario Outline: Verify redirection for "" in Tools menu - Given I click by text "Tools " - When I click by element with partial href "" and text "" - Then New page have "" address - - Examples: - | Sub-Section | url | redirect_url | - #| Portal | https://zksync.io/explore#bridges | https://portal.zksync.io | + | Sub-Section | url | + | Bridge | https://portal.zksync.io/bridge/?network=mainnet | #Account page @id259 @testnet From 95328826b0f9f789825dd3f6596230388c5e1421 Mon Sep 17 00:00:00 2001 From: Vasyl Ivanchuk Date: Sat, 3 Feb 2024 20:06:16 +0200 Subject: [PATCH 6/8] feat: add zkVM checkbox filter to verification page --- .../common/CheckBoxInput.stories.ts | 32 +++++++++++++ .../src/components/common/CheckBoxInput.vue | 46 ++++++++++++++++++ packages/app/src/components/form/FormItem.vue | 2 +- packages/app/src/locales/en.json | 3 +- .../src/views/ContractVerificationView.vue | 33 ++++++++++++- .../components/common/CheckBoxInput.spec.ts | 41 ++++++++++++++++ .../views/ContractVerificationView.spec.ts | 48 ++++++++++++++++++- 7 files changed, 199 insertions(+), 6 deletions(-) create mode 100644 packages/app/src/components/common/CheckBoxInput.stories.ts create mode 100644 packages/app/src/components/common/CheckBoxInput.vue create mode 100644 packages/app/tests/components/common/CheckBoxInput.spec.ts diff --git a/packages/app/src/components/common/CheckBoxInput.stories.ts b/packages/app/src/components/common/CheckBoxInput.stories.ts new file mode 100644 index 0000000000..beeeba7b2a --- /dev/null +++ b/packages/app/src/components/common/CheckBoxInput.stories.ts @@ -0,0 +1,32 @@ +import CheckBoxInput from "./CheckBoxInput.vue"; + +export default { + title: "Common/CheckBoxInput", + component: CheckBoxInput, +}; + +type Args = { + value: boolean; + modelValue: boolean; +}; + +const Template = (args: Args) => ({ + components: { CheckBoxInput }, + setup() { + return { args }; + }, + template: ` + CheckBox Input`, +}); + +export const Checked = Template.bind({}) as unknown as { args: Args }; +Checked.args = { + value: true, + modelValue: true, +}; + +export const Unchecked = Template.bind({}) as unknown as { args: Args }; +Unchecked.args = { + value: false, + modelValue: false, +}; diff --git a/packages/app/src/components/common/CheckBoxInput.vue b/packages/app/src/components/common/CheckBoxInput.vue new file mode 100644 index 0000000000..ac878bbec0 --- /dev/null +++ b/packages/app/src/components/common/CheckBoxInput.vue @@ -0,0 +1,46 @@ + + + + + + + diff --git a/packages/app/src/components/form/FormItem.vue b/packages/app/src/components/form/FormItem.vue index 8e179ae1be..f5a72f24e3 100644 --- a/packages/app/src/components/form/FormItem.vue +++ b/packages/app/src/components/form/FormItem.vue @@ -42,7 +42,7 @@ defineProps({ } .label-inline-block { .form-item-label { - @apply inline-block; + @apply float-left; } } diff --git a/packages/app/src/locales/en.json b/packages/app/src/locales/en.json index ee0c84942a..e4b231daf5 100644 --- a/packages/app/src/locales/en.json +++ b/packages/app/src/locales/en.json @@ -457,7 +457,8 @@ "validation": { "required": "Solc version is required" }, - "error": "Unable to get list of supported Solc versions" + "error": "Unable to get list of supported Solc versions", + "zkVM": "zkVM" }, "zksolcVersion": { "label": "Zksolc Version", diff --git a/packages/app/src/views/ContractVerificationView.vue b/packages/app/src/views/ContractVerificationView.vue index 0e7e8bd339..52f01622f1 100644 --- a/packages/app/src/views/ContractVerificationView.vue +++ b/packages/app/src/views/ContractVerificationView.vue @@ -90,6 +90,7 @@ >{{ t(`contractVerification.form.${selectedZkCompiler.name}Version.details`) }} - + + {{ t("contractVerification.form.solcVersion.zkVM") }} [ }, ]); +const isZkVMSolcCompiler = ref(false); const selectedCompilationType = ref(CompilationTypeOptionsEnum.soliditySingleFile); const isSingleFile = computed(() => [CompilationTypeOptionsEnum.soliditySingleFile, CompilationTypeOptionsEnum.vyperSingleFile].includes( @@ -350,7 +366,16 @@ const selectedZkCompiler = computed(() => { }); const selectedCompiler = computed(() => { const compiler = compilerTypeMap[selectedCompilationType.value].compiler; - return compilerVersions.value[compiler]; + const compilerInfo = compilerVersions.value[compiler]; + if (compiler === CompilerEnum.solc) { + return { + ...compilerInfo, + versions: compilerInfo.versions?.filter((version) => + isZkVMSolcCompiler.value ? version.startsWith(zkVMVersionPrefix) : !version.startsWith(zkVMVersionPrefix) + ), + }; + } + return compilerInfo; }); const selectedZkCompilerVersion = ref( selectedZkCompiler.value.versions[selectedZkCompiler.value.versions.length - 1] || "" @@ -496,6 +521,10 @@ const v$ = useVuelidate( form ); +function onZkVMSelectionChanged() { + selectedCompilerVersion.value = selectedCompiler.value.versions[0] || ""; +} + function onCompilationTypeChange() { selectedZkCompilerVersion.value = selectedZkCompiler.value.versions[0] || ""; selectedCompilerVersion.value = selectedCompiler.value.versions[0] || ""; diff --git a/packages/app/tests/components/common/CheckBoxInput.spec.ts b/packages/app/tests/components/common/CheckBoxInput.spec.ts new file mode 100644 index 0000000000..059c419826 --- /dev/null +++ b/packages/app/tests/components/common/CheckBoxInput.spec.ts @@ -0,0 +1,41 @@ +import { describe, expect, it } from "vitest"; + +import { render } from "@testing-library/vue"; + +import CheckBoxInput from "@/components/common/CheckBoxInput.vue"; + +describe("CheckBoxInput", () => { + it("renders default slot", () => { + const { container } = render(CheckBoxInput, { + slots: { + default: { + template: "CheckBox Input", + }, + }, + props: { + value: true, + }, + }); + expect(container.textContent).toBe("CheckBox Input"); + }); + it("renders checked state correctly", async () => { + const { container } = render(CheckBoxInput, { + props: { + modelValue: true, + value: true, + }, + }); + expect(container.querySelector(".checkbox-input-container")!.classList.contains("checked")).toBe(true); + expect(container.querySelector(".checkbox-input-container input")?.checked).toBe(true); + }); + it("renders unchecked state correctly", async () => { + const { container } = render(CheckBoxInput, { + props: { + modelValue: false, + value: false, + }, + }); + expect(container.querySelector(".checkbox-input-container")!.classList.contains("checked")).toBe(false); + expect(container.querySelector(".checkbox-input-container input")?.checked).toBe(false); + }); +}); diff --git a/packages/app/tests/views/ContractVerificationView.spec.ts b/packages/app/tests/views/ContractVerificationView.spec.ts index 160d4e5117..064dcb4a89 100644 --- a/packages/app/tests/views/ContractVerificationView.spec.ts +++ b/packages/app/tests/views/ContractVerificationView.spec.ts @@ -44,13 +44,11 @@ describe("ContractVerificationView:", () => { en: enUS, }, }); - it("has correct title", async () => { expect(i18n.global.t(routes.find((e) => e.name === "contract-verification")?.meta?.title as string)).toBe( "Smart Contract Verification" ); }); - it("uses contract address from query", async () => { const wrapper = mount(ContractVerificationView, { global: { @@ -113,6 +111,52 @@ describe("ContractVerificationView:", () => { expect(wrapper.find("#sourceCode").exists()).toBe(false); expect(wrapper.find(".multi-file-verification").exists()).toBe(true); }); + it("shows zkVM checkbox by default", async () => { + const wrapper = mount(ContractVerificationView, { + global: { + stubs: ["router-link"], + plugins: [i18n, $testId], + }, + }); + + expect(wrapper.find(".checkbox-input-container").exists()).toBe(true); + }); + it("shows zkVM checkbox when solidity MFV was selected", async () => { + const wrapper = mount(ContractVerificationView, { + global: { + stubs: ["router-link"], + plugins: [i18n, $testId], + }, + }); + + await wrapper.find("#compilerType").trigger("click"); + await wrapper.find(`[aria-labelledby="compilerType"] > li:nth-child(2)`).trigger("click"); + expect(wrapper.find(".checkbox-input-container").exists()).toBe(true); + }); + it("doesn't show zkVM checkbox when vyper single file verification was select", async () => { + const wrapper = mount(ContractVerificationView, { + global: { + stubs: ["router-link"], + plugins: [i18n, $testId], + }, + }); + + await wrapper.find("#compilerType").trigger("click"); + await wrapper.find(`[aria-labelledby="compilerType"] > li:nth-child(3)`).trigger("click"); + expect(wrapper.find(".checkbox-input-container").exists()).toBe(false); + }); + it("doesn't show zkVM checkbox when vyper MFV was select", async () => { + const wrapper = mount(ContractVerificationView, { + global: { + stubs: ["router-link"], + plugins: [i18n, $testId], + }, + }); + + await wrapper.find("#compilerType").trigger("click"); + await wrapper.find(`[aria-labelledby="compilerType"] > li:nth-child(4)`).trigger("click"); + expect(wrapper.find(".checkbox-input-container").exists()).toBe(false); + }); it("shows custom error text", async () => { const mock = vi.spyOn(useContractVerification, "default").mockReturnValue({ ...useContractVerification.default(), From 3688a42edb8b8b7a20ba5ac8eefade961bef9b05 Mon Sep 17 00:00:00 2001 From: Vasyl Ivanchuk Date: Mon, 5 Feb 2024 17:53:34 +0200 Subject: [PATCH 7/8] fix: checkbox input type --- packages/app/src/components/common/CheckBoxInput.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/app/src/components/common/CheckBoxInput.vue b/packages/app/src/components/common/CheckBoxInput.vue index ac878bbec0..e0a8323868 100644 --- a/packages/app/src/components/common/CheckBoxInput.vue +++ b/packages/app/src/components/common/CheckBoxInput.vue @@ -15,11 +15,11 @@ export default { import { computed } from "vue"; const props = defineProps({ modelValue: { - type: [Boolean], + type: Boolean, default: null, }, value: { - type: [Boolean], + type: Boolean, required: true, }, }); From 82b5353a36c8f3402a1f26cec91b78b244b708e7 Mon Sep 17 00:00:00 2001 From: Vasyl Ivanchuk Date: Mon, 5 Feb 2024 18:02:35 +0200 Subject: [PATCH 8/8] fix: remove value variable from the CheckBoxInput component --- .../app/src/components/common/CheckBoxInput.stories.ts | 3 --- packages/app/src/components/common/CheckBoxInput.vue | 8 ++------ packages/app/src/views/ContractVerificationView.vue | 1 - .../app/tests/components/common/CheckBoxInput.spec.ts | 4 +--- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/packages/app/src/components/common/CheckBoxInput.stories.ts b/packages/app/src/components/common/CheckBoxInput.stories.ts index beeeba7b2a..6f1d6a20fc 100644 --- a/packages/app/src/components/common/CheckBoxInput.stories.ts +++ b/packages/app/src/components/common/CheckBoxInput.stories.ts @@ -6,7 +6,6 @@ export default { }; type Args = { - value: boolean; modelValue: boolean; }; @@ -21,12 +20,10 @@ const Template = (args: Args) => ({ export const Checked = Template.bind({}) as unknown as { args: Args }; Checked.args = { - value: true, modelValue: true, }; export const Unchecked = Template.bind({}) as unknown as { args: Args }; Unchecked.args = { - value: false, modelValue: false, }; diff --git a/packages/app/src/components/common/CheckBoxInput.vue b/packages/app/src/components/common/CheckBoxInput.vue index e0a8323868..04f1de75b6 100644 --- a/packages/app/src/components/common/CheckBoxInput.vue +++ b/packages/app/src/components/common/CheckBoxInput.vue @@ -1,6 +1,6 @@ @@ -18,10 +18,6 @@ const props = defineProps({ type: Boolean, default: null, }, - value: { - type: Boolean, - required: true, - }, }); const emit = defineEmits<{ (eventName: "update:modelValue", value: unknown): void; diff --git a/packages/app/src/views/ContractVerificationView.vue b/packages/app/src/views/ContractVerificationView.vue index 52f01622f1..2bc9272bfa 100644 --- a/packages/app/src/views/ContractVerificationView.vue +++ b/packages/app/src/views/ContractVerificationView.vue @@ -112,7 +112,6 @@ {{ t("contractVerification.form.solcVersion.zkVM") }} diff --git a/packages/app/tests/components/common/CheckBoxInput.spec.ts b/packages/app/tests/components/common/CheckBoxInput.spec.ts index 059c419826..f51e052269 100644 --- a/packages/app/tests/components/common/CheckBoxInput.spec.ts +++ b/packages/app/tests/components/common/CheckBoxInput.spec.ts @@ -13,7 +13,7 @@ describe("CheckBoxInput", () => { }, }, props: { - value: true, + modelValue: true, }, }); expect(container.textContent).toBe("CheckBox Input"); @@ -22,7 +22,6 @@ describe("CheckBoxInput", () => { const { container } = render(CheckBoxInput, { props: { modelValue: true, - value: true, }, }); expect(container.querySelector(".checkbox-input-container")!.classList.contains("checked")).toBe(true); @@ -32,7 +31,6 @@ describe("CheckBoxInput", () => { const { container } = render(CheckBoxInput, { props: { modelValue: false, - value: false, }, }); expect(container.querySelector(".checkbox-input-container")!.classList.contains("checked")).toBe(false);