From caa2d83247fcd245cbe0aabb1a106ca17da5d2d6 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com> Date: Sun, 19 Jan 2025 02:34:05 -0800 Subject: [PATCH 01/14] Update staging hosts --- frontend/proxy.conf.staging.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/proxy.conf.staging.js b/frontend/proxy.conf.staging.js index e24662038..e6f33698b 100644 --- a/frontend/proxy.conf.staging.js +++ b/frontend/proxy.conf.staging.js @@ -3,8 +3,8 @@ const fs = require('fs'); let PROXY_CONFIG = require('./proxy.conf'); PROXY_CONFIG.forEach(entry => { - entry.target = entry.target.replace("mempool.space", "mempool-staging.fra.mempool.space"); - entry.target = entry.target.replace("liquid.network", "liquid-staging.fra.mempool.space"); + entry.target = entry.target.replace("mempool.space", "node201.fmt.mempool.space"); + entry.target = entry.target.replace("liquid.network", "liquid-staging.fmt.mempool.space"); }); module.exports = PROXY_CONFIG; From 671b5ea2f2eb3ce9515a233702c5b784093f77c1 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Sun, 19 Jan 2025 12:24:26 -0800 Subject: [PATCH 02/14] Reroute testnet4 tests to a different server --- .github/workflows/ci.yml | 1 + frontend/proxy.conf.staging.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a29e9184..767cf2694 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -327,6 +327,7 @@ jobs: browser: "chrome" ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}" env: + CYPRESS_REROUTE_TESTNET: ${{ matrix.spec == 'cypress/e2e/testnet4/*.spec.ts' }} COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/frontend/proxy.conf.staging.js b/frontend/proxy.conf.staging.js index e6f33698b..eda7d2b9d 100644 --- a/frontend/proxy.conf.staging.js +++ b/frontend/proxy.conf.staging.js @@ -3,7 +3,8 @@ const fs = require('fs'); let PROXY_CONFIG = require('./proxy.conf'); PROXY_CONFIG.forEach(entry => { - entry.target = entry.target.replace("mempool.space", "node201.fmt.mempool.space"); + const hostname = process.env.CYPRESS_REROUTE_TESTNET ? 'node201.fmt.mempool.space' : 'mempool-staging.fra.mempool.space'; + entry.target = entry.target.replace("mempool.space", hostname); entry.target = entry.target.replace("liquid.network", "liquid-staging.fmt.mempool.space"); }); From 34099e386112b781d7b70ca886f35cab8d23d969 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Sun, 19 Jan 2025 12:32:37 -0800 Subject: [PATCH 03/14] Stop switching to testnet4 until we can check for the proxied server --- frontend/cypress/e2e/mainnet/mainnet.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/e2e/mainnet/mainnet.spec.ts b/frontend/cypress/e2e/mainnet/mainnet.spec.ts index a1082b769..7e17c09cd 100644 --- a/frontend/cypress/e2e/mainnet/mainnet.spec.ts +++ b/frontend/cypress/e2e/mainnet/mainnet.spec.ts @@ -344,7 +344,9 @@ describe('Mainnet', () => { cy.visit('/'); cy.waitForSkeletonGone(); - cy.changeNetwork('testnet4'); + //TODO(knorrium): add a check for the proxied server + // cy.changeNetwork('testnet4'); + cy.changeNetwork('signet'); cy.changeNetwork('mainnet'); }); From 7e766cc28db6e67386aab486a5d2e4e35eb3fda1 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Sun, 19 Jan 2025 12:36:20 -0800 Subject: [PATCH 04/14] Change spec test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 767cf2694..af05a2448 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -327,7 +327,7 @@ jobs: browser: "chrome" ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}" env: - CYPRESS_REROUTE_TESTNET: ${{ matrix.spec == 'cypress/e2e/testnet4/*.spec.ts' }} + CYPRESS_REROUTE_TESTNET: ${{ contains(matrix.spec, 'testnet') }} COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 517a30d2b0e76c6a88e25b0e0d4c4dfc61597038 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Sun, 19 Jan 2025 13:25:29 -0800 Subject: [PATCH 05/14] Split module and spec matrix --- .github/workflows/ci.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af05a2448..594df2a9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,16 +252,23 @@ jobs: fail-fast: false matrix: module: ["mempool", "liquid"] + spec: + - "cypress/e2e/mainnet/*.spec.ts" + - "cypress/e2e/signet/*.spec.ts" + - "cypress/e2e/testnet4/*.spec.ts" + - "cypress/e2e/liquid/liquid.spec.ts" + - "cypress/e2e/liquidtestnet/liquidtestnet.spec.ts" include: - module: "mempool" - spec: | - cypress/e2e/mainnet/*.spec.ts - cypress/e2e/signet/*.spec.ts - cypress/e2e/testnet4/*.spec.ts + spec: "cypress/e2e/mainnet/*.spec.ts" + - module: "mempool" + spec: "cypress/e2e/signet/*.spec.ts" + - module: "mempool" + spec: "cypress/e2e/testnet4/*.spec.ts" - module: "liquid" - spec: | - cypress/e2e/liquid/liquid.spec.ts - cypress/e2e/liquidtestnet/liquidtestnet.spec.ts + spec: "cypress/e2e/liquid/liquid.spec.ts" + - module: "liquid" + spec: "cypress/e2e/liquidtestnet/liquidtestnet.spec.ts" name: E2E tests for ${{ matrix.module }} steps: From e9e8b0c758c476e705a5696268808838a7c3ff58 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Sun, 19 Jan 2025 13:38:06 -0800 Subject: [PATCH 06/14] Use testnet as a matrix config instead --- .github/workflows/ci.yml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 594df2a9f..7cff27841 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,24 +251,19 @@ jobs: strategy: fail-fast: false matrix: - module: ["mempool", "liquid"] - spec: - - "cypress/e2e/mainnet/*.spec.ts" - - "cypress/e2e/signet/*.spec.ts" - - "cypress/e2e/testnet4/*.spec.ts" - - "cypress/e2e/liquid/liquid.spec.ts" - - "cypress/e2e/liquidtestnet/liquidtestnet.spec.ts" + module: ["mempool", "liquid", "testnet4"] include: - module: "mempool" - spec: "cypress/e2e/mainnet/*.spec.ts" - - module: "mempool" - spec: "cypress/e2e/signet/*.spec.ts" - - module: "mempool" - spec: "cypress/e2e/testnet4/*.spec.ts" + spec: | + cypress/e2e/mainnet/*.spec.ts + cypress/e2e/signet/*.spec.ts + - module: "testnet4" + spec: | + cypress/e2e/testnet4/*.spec.ts - module: "liquid" - spec: "cypress/e2e/liquid/liquid.spec.ts" - - module: "liquid" - spec: "cypress/e2e/liquidtestnet/liquidtestnet.spec.ts" + spec: | + cypress/e2e/liquid/liquid.spec.ts + cypress/e2e/liquidtestnet/liquidtestnet.spec.ts name: E2E tests for ${{ matrix.module }} steps: @@ -334,7 +329,7 @@ jobs: browser: "chrome" ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}" env: - CYPRESS_REROUTE_TESTNET: ${{ contains(matrix.spec, 'testnet') }} + CYPRESS_REROUTE_TESTNET: ${{ contains(matrix.spec, 'testnet4') }} COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7f6399093eafa5aeb74aa81ab2b136502c76bd6e Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Sun, 19 Jan 2025 13:56:16 -0800 Subject: [PATCH 07/14] Fix YAML --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cff27841..784a02afc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -258,8 +258,8 @@ jobs: cypress/e2e/mainnet/*.spec.ts cypress/e2e/signet/*.spec.ts - module: "testnet4" - spec: | - cypress/e2e/testnet4/*.spec.ts + spec: | + cypress/e2e/testnet4/*.spec.ts - module: "liquid" spec: | cypress/e2e/liquid/liquid.spec.ts From f59e95fcc8419426550be6bad69c6507e87179c4 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Sun, 19 Jan 2025 14:11:41 -0800 Subject: [PATCH 08/14] Run the default mempool config if we are running testnet4 tests --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 784a02afc..146372f40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -318,7 +318,7 @@ jobs: with: tag: ${{ github.event_name }} working-directory: ${{ matrix.module }}/frontend - build: npm run config:defaults:${{ matrix.module }} + build: ${{ matrix.module == 'testnet4' && 'npm run config:defaults:mempool' || 'npm run config:defaults:${{ matrix.module }}' }} start: npm run start:local-staging wait-on: "http://localhost:4200" wait-on-timeout: 120 From 1098d2fe3c44b83624d3e17cda2ea73643d3dcf8 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Sun, 19 Jan 2025 14:21:23 -0800 Subject: [PATCH 09/14] Change build step to shell script --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 146372f40..ac5326323 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -318,7 +318,12 @@ jobs: with: tag: ${{ github.event_name }} working-directory: ${{ matrix.module }}/frontend - build: ${{ matrix.module == 'testnet4' && 'npm run config:defaults:mempool' || 'npm run config:defaults:${{ matrix.module }}' }} + build: | + if [[ "${{ matrix.module }}" == "testnet4" ]]; then + npm run config:defaults:mempool + else + npm run config:defaults:${{ matrix.module }} + fi start: npm run start:local-staging wait-on: "http://localhost:4200" wait-on-timeout: 120 From 3d1aacbd66e69f830a6b0034577fa284696dd2ff Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Sun, 19 Jan 2025 19:21:02 -0800 Subject: [PATCH 10/14] Copypasta matrix for tests --- .github/workflows/ci.yml | 80 +++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac5326323..6d2fc387f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,18 +252,6 @@ jobs: fail-fast: false matrix: module: ["mempool", "liquid", "testnet4"] - include: - - module: "mempool" - spec: | - cypress/e2e/mainnet/*.spec.ts - cypress/e2e/signet/*.spec.ts - - module: "testnet4" - spec: | - cypress/e2e/testnet4/*.spec.ts - - module: "liquid" - spec: | - cypress/e2e/liquid/liquid.spec.ts - cypress/e2e/liquidtestnet/liquidtestnet.spec.ts name: E2E tests for ${{ matrix.module }} steps: @@ -312,29 +300,77 @@ jobs: - name: Unzip assets before building (src/resources) run: unzip -o promo-video-assets.zip -d ${{ matrix.module }}/frontend/src/resources/promo-video - + + # mempool - name: Chrome browser tests (${{ matrix.module }}) + if: ${{ matrix.module == 'mempool' }} uses: cypress-io/github-action@v5 with: tag: ${{ github.event_name }} working-directory: ${{ matrix.module }}/frontend - build: | - if [[ "${{ matrix.module }}" == "testnet4" ]]; then - npm run config:defaults:mempool - else - npm run config:defaults:${{ matrix.module }} - fi + build: npm run config:defaults:${{ matrix.module }} start: npm run start:local-staging wait-on: "http://localhost:4200" wait-on-timeout: 120 record: true parallel: true - spec: ${{ matrix.spec }} + spec: | + cypress/e2e/mainnet/*.spec.ts + cypress/e2e/signet/*.spec.ts group: Tests on Chrome (${{ matrix.module }}) browser: "chrome" ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}" env: - CYPRESS_REROUTE_TESTNET: ${{ contains(matrix.spec, 'testnet4') }} + COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} + + # liquid + - name: Chrome browser tests (${{ matrix.module }}) + if: ${{ matrix.module == 'liquid' }} + uses: cypress-io/github-action@v5 + with: + tag: ${{ github.event_name }} + working-directory: ${{ matrix.module }}/frontend + build: npm run config:defaults:${{ matrix.module }} + start: npm run start:local-staging + wait-on: "http://localhost:4200" + wait-on-timeout: 120 + record: true + parallel: true + spec: | + cypress/e2e/liquid/liquid.spec.ts + cypress/e2e/liquidtestnet/liquidtestnet.spec.ts + group: Tests on Chrome (${{ matrix.module }}) + browser: "chrome" + ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}" + env: + COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} + + # testnet + - name: Chrome browser tests (${{ matrix.module }}) + if: ${{ matrix.module == 'testnet4' }} + uses: cypress-io/github-action@v5 + with: + tag: ${{ github.event_name }} + working-directory: ${{ matrix.module }}/frontend + build: npm run config:defaults:mempool + start: npm run start:local-staging + wait-on: "http://localhost:4200" + wait-on-timeout: 120 + record: true + parallel: true + spec: | + cypress/e2e/testnet4/*.spec.ts + group: Tests on Chrome (${{ matrix.module }}) + browser: "chrome" + ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}" + env: + CYPRESS_REROUTE_TESTNET: true COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -367,4 +403,4 @@ jobs: - name: Validate JSON syntax run: | cat mempool-config.json | jq - working-directory: docker/docker/backend + working-directory: docker/docker/backend \ No newline at end of file From 227d99e9909d1401867f3cb6258e2c4c4b05ead9 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Sun, 19 Jan 2025 19:35:08 -0800 Subject: [PATCH 11/14] Fix reroute logic --- frontend/proxy.conf.staging.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/proxy.conf.staging.js b/frontend/proxy.conf.staging.js index eda7d2b9d..260b222c0 100644 --- a/frontend/proxy.conf.staging.js +++ b/frontend/proxy.conf.staging.js @@ -3,7 +3,8 @@ const fs = require('fs'); let PROXY_CONFIG = require('./proxy.conf'); PROXY_CONFIG.forEach(entry => { - const hostname = process.env.CYPRESS_REROUTE_TESTNET ? 'node201.fmt.mempool.space' : 'mempool-staging.fra.mempool.space'; + const hostname = process.env.CYPRESS_REROUTE_TESTNET === 'true' ? 'mempool-staging.fra.mempool.space' : 'node201.fmt.mempool.space'; + console.log(`e2e tests running against ${hostname}`); entry.target = entry.target.replace("mempool.space", hostname); entry.target = entry.target.replace("liquid.network", "liquid-staging.fmt.mempool.space"); }); From 003956fd16caed93a243c37095cae48c667b544a Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Sun, 19 Jan 2025 19:48:12 -0800 Subject: [PATCH 12/14] Update staging hosts Add rerouting logic for testnet4 tests Split CI e2e workflow matrix into mempool, liquid and testnet4 --- .github/workflows/ci.yml | 72 ++++++++++++++++---- frontend/cypress/e2e/mainnet/mainnet.spec.ts | 4 +- frontend/proxy.conf.staging.js | 6 +- 3 files changed, 65 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a29e9184..6d2fc387f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,17 +251,7 @@ jobs: strategy: fail-fast: false matrix: - module: ["mempool", "liquid"] - include: - - module: "mempool" - spec: | - cypress/e2e/mainnet/*.spec.ts - cypress/e2e/signet/*.spec.ts - cypress/e2e/testnet4/*.spec.ts - - module: "liquid" - spec: | - cypress/e2e/liquid/liquid.spec.ts - cypress/e2e/liquidtestnet/liquidtestnet.spec.ts + module: ["mempool", "liquid", "testnet4"] name: E2E tests for ${{ matrix.module }} steps: @@ -310,8 +300,10 @@ jobs: - name: Unzip assets before building (src/resources) run: unzip -o promo-video-assets.zip -d ${{ matrix.module }}/frontend/src/resources/promo-video - + + # mempool - name: Chrome browser tests (${{ matrix.module }}) + if: ${{ matrix.module == 'mempool' }} uses: cypress-io/github-action@v5 with: tag: ${{ github.event_name }} @@ -322,7 +314,9 @@ jobs: wait-on-timeout: 120 record: true parallel: true - spec: ${{ matrix.spec }} + spec: | + cypress/e2e/mainnet/*.spec.ts + cypress/e2e/signet/*.spec.ts group: Tests on Chrome (${{ matrix.module }}) browser: "chrome" ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}" @@ -332,6 +326,56 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} + # liquid + - name: Chrome browser tests (${{ matrix.module }}) + if: ${{ matrix.module == 'liquid' }} + uses: cypress-io/github-action@v5 + with: + tag: ${{ github.event_name }} + working-directory: ${{ matrix.module }}/frontend + build: npm run config:defaults:${{ matrix.module }} + start: npm run start:local-staging + wait-on: "http://localhost:4200" + wait-on-timeout: 120 + record: true + parallel: true + spec: | + cypress/e2e/liquid/liquid.spec.ts + cypress/e2e/liquidtestnet/liquidtestnet.spec.ts + group: Tests on Chrome (${{ matrix.module }}) + browser: "chrome" + ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}" + env: + COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} + + # testnet + - name: Chrome browser tests (${{ matrix.module }}) + if: ${{ matrix.module == 'testnet4' }} + uses: cypress-io/github-action@v5 + with: + tag: ${{ github.event_name }} + working-directory: ${{ matrix.module }}/frontend + build: npm run config:defaults:mempool + start: npm run start:local-staging + wait-on: "http://localhost:4200" + wait-on-timeout: 120 + record: true + parallel: true + spec: | + cypress/e2e/testnet4/*.spec.ts + group: Tests on Chrome (${{ matrix.module }}) + browser: "chrome" + ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}" + env: + CYPRESS_REROUTE_TESTNET: true + COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} + validate_docker_json: if: "!contains(github.event.pull_request.labels.*.name, 'ops') && !contains(github.head_ref, 'ops/')" runs-on: "ubuntu-latest" @@ -359,4 +403,4 @@ jobs: - name: Validate JSON syntax run: | cat mempool-config.json | jq - working-directory: docker/docker/backend + working-directory: docker/docker/backend \ No newline at end of file diff --git a/frontend/cypress/e2e/mainnet/mainnet.spec.ts b/frontend/cypress/e2e/mainnet/mainnet.spec.ts index a1082b769..7e17c09cd 100644 --- a/frontend/cypress/e2e/mainnet/mainnet.spec.ts +++ b/frontend/cypress/e2e/mainnet/mainnet.spec.ts @@ -344,7 +344,9 @@ describe('Mainnet', () => { cy.visit('/'); cy.waitForSkeletonGone(); - cy.changeNetwork('testnet4'); + //TODO(knorrium): add a check for the proxied server + // cy.changeNetwork('testnet4'); + cy.changeNetwork('signet'); cy.changeNetwork('mainnet'); }); diff --git a/frontend/proxy.conf.staging.js b/frontend/proxy.conf.staging.js index e24662038..260b222c0 100644 --- a/frontend/proxy.conf.staging.js +++ b/frontend/proxy.conf.staging.js @@ -3,8 +3,10 @@ const fs = require('fs'); let PROXY_CONFIG = require('./proxy.conf'); PROXY_CONFIG.forEach(entry => { - entry.target = entry.target.replace("mempool.space", "mempool-staging.fra.mempool.space"); - entry.target = entry.target.replace("liquid.network", "liquid-staging.fra.mempool.space"); + const hostname = process.env.CYPRESS_REROUTE_TESTNET === 'true' ? 'mempool-staging.fra.mempool.space' : 'node201.fmt.mempool.space'; + console.log(`e2e tests running against ${hostname}`); + entry.target = entry.target.replace("mempool.space", hostname); + entry.target = entry.target.replace("liquid.network", "liquid-staging.fmt.mempool.space"); }); module.exports = PROXY_CONFIG; From 390bbf1097ca2cc65bc2b5d6cb45c54fa7a5ef44 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Mon, 20 Jan 2025 15:20:29 +0900 Subject: [PATCH 13/14] add new fa icon --- frontend/src/app/shared/shared.module.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts index 1d4f5fd99..283f9eb54 100644 --- a/frontend/src/app/shared/shared.module.ts +++ b/frontend/src/app/shared/shared.module.ts @@ -7,7 +7,7 @@ import { faFilter, faAngleDown, faAngleUp, faAngleRight, faAngleLeft, faBolt, fa faFileAlt, faRedoAlt, faArrowAltCircleRight, faExternalLinkAlt, faBook, faListUl, faDownload, faQrcode, faArrowRightArrowLeft, faArrowsRotate, faCircleLeft, faFastForward, faWallet, faUserClock, faWrench, faUserFriends, faQuestionCircle, faHistory, faSignOutAlt, faKey, faSuitcase, faIdCardAlt, faNetworkWired, faUserCheck, faCircleCheck, faUserCircle, faCheck, faRocket, faScaleBalanced, faHourglassStart, faHourglassHalf, faHourglassEnd, faWandMagicSparkles, faFaucetDrip, faTimeline, - faCircleXmark, faCalendarCheck, faMoneyBillTrendUp, faRobot } from '@fortawesome/free-solid-svg-icons'; + faCircleXmark, faCalendarCheck, faMoneyBillTrendUp, faRobot, faShareNodes } from '@fortawesome/free-solid-svg-icons'; import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { MenuComponent } from '@components/menu/menu.component'; import { PreviewTitleComponent } from '@components/master-page-preview/preview-title.component'; @@ -459,5 +459,6 @@ export class SharedModule { library.addIcons(faCalendarCheck); library.addIcons(faMoneyBillTrendUp); library.addIcons(faRobot); + library.addIcons(faShareNodes); } } From 4e735cc8b03d87f850286461474d8f110580e444 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 20 Jan 2025 07:30:27 +0000 Subject: [PATCH 14/14] fix stratum tree rendering with different branch lengths --- .../stratum-list/stratum-list.component.ts | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts index 0af9f0976..6f252babe 100644 --- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts +++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts @@ -8,8 +8,10 @@ import { SinglePoolStats } from '../../../interfaces/node-api.interface'; type MerkleCellType = ' ' | '┬' | '├' | '└' | '│' | '─' | 'leaf'; + interface TaggedStratumJob extends StratumJob { tag: string; + merkleBranchIds: string[]; } interface MerkleCell { @@ -46,6 +48,18 @@ function parseTag(scriptSig: string): string { return (ascii.match(/\/.*\//)?.[0] || ascii).trim(); } +function getMerkleBranchIds(merkleBranches: string[], numBranches: number): string[] { + let lastHash = ''; + const ids: string[] = []; + for (let i = 0; i < numBranches; i++) { + if (merkleBranches[i]) { + lastHash = merkleBranches[i]; + } + ids.push(`${i}-${lastHash}`); + } + return ids; +} + @Component({ selector: 'app-stratum-list', templateUrl: './stratum-list.component.html', @@ -81,16 +95,15 @@ export class StratumList implements OnInit, OnDestroy { } processJobs(rawJobs: Record): PoolRow[] { + const numBranches = Math.max(...Object.values(rawJobs).map(job => job.merkleBranches.length)); const jobs: Record = {}; for (const [id, job] of Object.entries(rawJobs)) { - jobs[id] = { ...job, tag: parseTag(job.scriptsig) }; + jobs[id] = { ...job, tag: parseTag(job.scriptsig), merkleBranchIds: getMerkleBranchIds(job.merkleBranches, numBranches) }; } if (Object.keys(jobs).length === 0) { return []; } - const numBranches = Math.max(...Object.values(jobs).map(job => job.merkleBranches.length)); - let trees: MerkleTree[] = Object.keys(jobs).map(job => ({ job, size: 1, @@ -100,12 +113,13 @@ export class StratumList implements OnInit, OnDestroy { for (let col = numBranches - 1; col >= 0; col--) { const groups: Record = {}; for (const tree of trees) { - const hash = jobs[tree.job].merkleBranches[col]; - if (!groups[hash]) { - groups[hash] = []; + const branchId = jobs[tree.job].merkleBranchIds[col]; + if (!groups[branchId]) { + groups[branchId] = []; } - groups[hash].push(tree); + groups[branchId].push(tree); } + trees = Object.values(groups).map(group => ({ hash: jobs[group[0].job].merkleBranches[col], job: group[0].job,