From e2bc6e40e4501562b17d5a685172c6206dacd792 Mon Sep 17 00:00:00 2001 From: Torresmorah Date: Tue, 29 Aug 2023 10:28:06 -0600 Subject: [PATCH 1/2] fix(workflows): remove backslash from string array --- .github/workflows/deploy-telos-testnet.yaml | 2 +- .github/workflows/deploy-telos.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-telos-testnet.yaml b/.github/workflows/deploy-telos-testnet.yaml index 3cbd1e9a..23c3b6c2 100644 --- a/.github/workflows/deploy-telos-testnet.yaml +++ b/.github/workflows/deploy-telos-testnet.yaml @@ -63,7 +63,7 @@ jobs: REACT_APP_PUBLIC_RE_CAPTCHA_KEY: ${{ secrets.REACT_APP_PUBLIC_RE_CAPTCHA_KEY }} REACT_APP_EVM_ENDPOINT: 'https://testnet.telos.net/evm' REACT_APP_EVM_BLOCK_EXPLORER_URL: 'https://testnet.teloscan.io/block/(block)' - REACT_APP_EVM_ENDPOINTS: '[\"https://testnet.telos.net/evm\"]' + REACT_APP_EVM_ENDPOINTS: '["https://testnet.telos.net/evm"]' - name: Build and deploy kubernetes files id: build_kubernetes_files diff --git a/.github/workflows/deploy-telos.yaml b/.github/workflows/deploy-telos.yaml index 3cf0807e..dc9c9dfd 100644 --- a/.github/workflows/deploy-telos.yaml +++ b/.github/workflows/deploy-telos.yaml @@ -63,7 +63,7 @@ jobs: REACT_APP_PUBLIC_RE_CAPTCHA_KEY: ${{ secrets.REACT_APP_PUBLIC_RE_CAPTCHA_KEY }} REACT_APP_EVM_ENDPOINT: 'https://mainnet.telos.net/evm' REACT_APP_EVM_BLOCK_EXPLORER_URL: 'https://www.teloscan.io/block/(block)' - REACT_APP_EVM_ENDPOINTS: '[\"https://rpc1.eu.telos.net/evm\",\"https://api.kainosbp.com/evm\",\"https://mainnet.telos.net/evm\",\"https://rpc1.us.telos.net/evm\",\"https://rpc2.eu.telos.net/evm\",\"https://rpc2.us.telos.net/evm\",\"https://evm.teloskorea.com/evm\",\"https://rpc2.teloskorea.com/evm\",\"https://rpc01.us.telosunlimited.io/evm\"]' + REACT_APP_EVM_ENDPOINTS: '["https://rpc1.eu.telos.net/evm","https://api.kainosbp.com/evm","https://mainnet.telos.net/evm","https://rpc1.us.telos.net/evm","https://rpc2.eu.telos.net/evm","https://rpc2.us.telos.net/evm","https://evm.teloskorea.com/evm","https://rpc2.teloskorea.com/evm","https://rpc01.us.telosunlimited.io/evm"]' - name: Build and deploy kubernetes files id: build_kubernetes_files From 0c65321e17ceda11f8ade38cddb22487c63f577b Mon Sep 17 00:00:00 2001 From: Torresmorah Date: Tue, 29 Aug 2023 10:31:03 -0600 Subject: [PATCH 2/2] fix(webapp): catch the error when parsing of endpoints fails --- webapp/src/config/evm.config.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/webapp/src/config/evm.config.js b/webapp/src/config/evm.config.js index 972b2fde..b16e4c09 100644 --- a/webapp/src/config/evm.config.js +++ b/webapp/src/config/evm.config.js @@ -1,6 +1,7 @@ import { eosConfig } from 'config' let _avgBlockTime = 'N/A' +let _endpoints switch (eosConfig.networkName) { case 'telos-testnet': @@ -15,9 +16,16 @@ switch (eosConfig.networkName) { break } +try { + _endpoints = JSON.parse(process.env.REACT_APP_EVM_ENDPOINTS || '[]') || [] +} catch (error) { + console.error(error) + _endpoints = [] +} + export const avgBlockTime = _avgBlockTime export const maxTPSDataSize = 30 / _avgBlockTime || 0 export const account = 'eosio.evm' export const endpoint = process.env.REACT_APP_EVM_ENDPOINT export const blockExplorerUrl = process.env.REACT_APP_EVM_BLOCK_EXPLORER_URL -export const endpoints = JSON.parse(process.env.REACT_APP_EVM_ENDPOINTS || '[]') || [] +export const endpoints = _endpoints