From d76de170ab34d85c5e5f568148fc1565d56e9d40 Mon Sep 17 00:00:00 2001 From: Jamie Caprani Date: Thu, 30 May 2024 16:16:50 +0100 Subject: [PATCH] chore: remove goerli network --- .env.e2e | 2 +- doc/how-to-launch-e2e.md | 2 +- .../ios/RCTStatus/LogManager.m | 12 ++--- scripts/build-android.sh | 3 -- shadow-cljs.edn | 9 ---- src/legacy/status_im/ethereum/tokens.cljs | 4 -- .../status_im/ethereum/transactions/core.cljs | 4 +- .../ui/screens/advanced_settings/views.cljs | 11 ----- src/status_im/config.cljs | 13 ++--- src/status_im/constants.cljs | 10 +--- src/status_im/contexts/profile/config.cljs | 3 -- .../contexts/profile/settings/events.cljs | 11 ----- .../contexts/wallet/collectible/events.cljs | 3 +- .../contexts/wallet/collectible/utils.cljs | 15 ++---- .../wallet/collectible/utils_test.cljs | 30 ++---------- .../wallet/common/utils/external_links.cljs | 6 --- .../wallet/common/utils/networks.cljs | 47 +++++-------------- .../wallet/common/utils/networks_test.cljs | 14 +++--- src/status_im/contexts/wallet/events.cljs | 7 +-- src/status_im/subs/profile.cljs | 6 --- src/status_im/subs/wallet/wallet.cljs | 6 +-- src/tests/contract_test/wallet_test.cljs | 22 --------- src/utils/ens/core.cljs | 2 +- src/utils/ens/stateofus.cljs | 9 ---- src/utils/ethereum/chain.cljs | 7 --- src/utils/ethereum/chain_test.cljs | 6 +-- src/utils/ethereum/eip/eip681_test.cljs | 13 ----- translations/en.json | 1 - 28 files changed, 49 insertions(+), 229 deletions(-) diff --git a/.env.e2e b/.env.e2e index 768448fa2a..e654333abe 100644 --- a/.env.e2e +++ b/.env.e2e @@ -1,5 +1,5 @@ DEBUG_WEBVIEW=1 -DEFAULT_NETWORK=goerli_rpc +DEFAULT_NETWORK= ETHEREUM_DEV_CLUSTER=1 EXTENSIONS=0 FLEET=status.prod diff --git a/doc/how-to-launch-e2e.md b/doc/how-to-launch-e2e.md index 66cceee035..83b2a25ab4 100644 --- a/doc/how-to-launch-e2e.md +++ b/doc/how-to-launch-e2e.md @@ -92,7 +92,7 @@ For particular example it was failed on `Recover access(password:qwerty, keycard Not all features of the app could be covered by e2e at the moment: - Colours or place of an element on UI. -- Real ETH/token transactions. That’s the main reason we have separate .apk build for automation needs - it defaults to Goerli network. Also it has enabled keycard test menu, ENS names and chat commands are also on Goerli network (the same in PR builds, but not in nightlies / release) +- Real ETH/token transactions. That’s the main reason we have separate .apk build for automation needs - it defaults to Sepolia network. Also it has enabled keycard test menu, ENS names and chat commands are also on Sepolia network (the same in PR builds, but not in nightlies / release) - Autologin/Biometric related actions (autologin available when device meets certain conditions like the it has set unlock password and device is not rooted: all emulators are rooted in SauceLabs) ## Brief flow for test to be automated diff --git a/modules/react-native-status/ios/RCTStatus/LogManager.m b/modules/react-native-status/ios/RCTStatus/LogManager.m index 1a5740b571..c5ffa8b6ed 100644 --- a/modules/react-native-status/ios/RCTStatus/LogManager.m +++ b/modules/react-native-status/ios/RCTStatus/LogManager.m @@ -41,18 +41,18 @@ RCT_EXPORT_METHOD(sendLogs:(NSString *)dbJson #endif #if DEBUG - NSString *goerliNetworkDirPath = @"ethereum/goerli_rpc_dev"; + NSString *sepoliaNetworkDirPath = @"ethereum/sepolia_rpc_dev"; #else - NSString *goerliNetworkDirPath = @"ethereum/goerli_rpc"; + NSString *sepoliaNetworkDirPath = @"ethereum/sepolia_rpc"; #endif NSURL *networkDir = [rootUrl URLByAppendingPathComponent:networkDirPath]; NSURL *originalGethLogsFile = [networkDir URLByAppendingPathComponent:@"geth.log"]; NSURL *gethLogsFile = [logsFolderName URLByAppendingPathComponent:@"mainnet_geth.log"]; - NSURL *goerliNetworkDir = [rootUrl URLByAppendingPathComponent:goerliNetworkDirPath]; - NSURL *goerliGethLogsFile = [goerliNetworkDir URLByAppendingPathComponent:@"geth.log"]; - NSURL *goerliLogsFile = [logsFolderName URLByAppendingPathComponent:@"goerli_geth.log"]; + NSURL *sepoliaNetworkDir = [rootUrl URLByAppendingPathComponent:sepoliaNetworkDirPath]; + NSURL *sepoliaGethLogsFile = [sepoliaNetworkDir URLByAppendingPathComponent:@"geth.log"]; + NSURL *sepoliaLogsFile = [logsFolderName URLByAppendingPathComponent:@"sepolia_geth.log"]; NSURL *mainGethLogsFile = [rootUrl URLByAppendingPathComponent:@"geth.log"]; NSURL *mainLogsFile = [logsFolderName URLByAppendingPathComponent:@"geth.log"]; @@ -63,7 +63,7 @@ RCT_EXPORT_METHOD(sendLogs:(NSString *)dbJson //NSString* gethLogs = StatusgoExportNodeLogs(); //[gethLogs writeToFile:gethLogsFile.path atomically:YES encoding:NSUTF8StringEncoding error:nil]; [fileManager copyItemAtPath:originalGethLogsFile.path toPath:gethLogsFile.path error:nil]; - [fileManager copyItemAtPath:goerliGethLogsFile.path toPath:goerliLogsFile.path error:nil]; + [fileManager copyItemAtPath:sepoliaGethLogsFile.path toPath:sepoliaLogsFile.path error:nil]; [fileManager copyItemAtPath:mainGethLogsFile.path toPath:mainLogsFile.path error:nil]; [SSZipArchive createZipFileAtPath:zipFile.path withContentsOfDirectory:logsFolderName.path]; diff --git a/scripts/build-android.sh b/scripts/build-android.sh index eeb3a8e573..88cb90cecd 100755 --- a/scripts/build-android.sh +++ b/scripts/build-android.sh @@ -32,12 +32,9 @@ trap "rm -vf ${SECRETS_FILE_PATH}" EXIT ERR INT QUIT # Names of variables containing secrets to save in env file. SECRETS_ENV_VARS=( 'ALCHEMY_ETHEREUM_MAINNET_TOKEN' - 'ALCHEMY_ETHEREUM_GOERLI_TOKEN' 'ALCHEMY_ETHEREUM_SEPOLIA_TOKEN' - 'ALCHEMY_ARBITRUM_GOERLI_TOKEN' 'ALCHEMY_ARBITRUM_MAINNET_TOKEN' 'ALCHEMY_ARBITRUM_SEPOLIA_TOKEN' - 'ALCHEMY_OPTIMISM_GOERLI_TOKEN' 'ALCHEMY_OPTIMISM_MAINNET_TOKEN' 'ALCHEMY_OPTIMISM_SEPOLIA_TOKEN' 'RARIBLE_MAINNET_API_KEY' diff --git a/shadow-cljs.edn b/shadow-cljs.edn index d9f226b1b8..640fcdef6e 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -71,13 +71,10 @@ status-im.config/RARIBLE_MAINNET_API_KEY #shadow/env "RARIBLE_MAINNET_API_KEY" status-im.config/RARIBLE_TESTNET_API_KEY #shadow/env "RARIBLE_TESTNET_API_KEY" status-im.config/ALCHEMY_ETHEREUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ETHEREUM_MAINNET_TOKEN" - status-im.config/ALCHEMY_ETHEREUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ETHEREUM_GOERLI_TOKEN" status-im.config/ALCHEMY_ETHEREUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ETHEREUM_SEPOLIA_TOKEN" status-im.config/ALCHEMY_ARBITRUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ARBITRUM_MAINNET_TOKEN" - status-im.config/ALCHEMY_ARBITRUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ARBITRUM_GOERLI_TOKEN" status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN" status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN" - status-im.config/ALCHEMY_OPTIMISM_GOERLI_TOKEN #shadow/env "ALCHEMY_OPTIMISM_GOERLI_TOKEN" status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"} :compiler-options {:output-feature-set :es5 ;; We disable `:fn-deprecated` warnings because we @@ -105,13 +102,10 @@ status-im.config/RARIBLE_MAINNET_API_KEY #shadow/env "RARIBLE_MAINNET_API_KEY" status-im.config/RARIBLE_TESTNET_API_KEY #shadow/env "RARIBLE_TESTNET_API_KEY" status-im.config/ALCHEMY_ETHEREUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ETHEREUM_MAINNET_TOKEN" - status-im.config/ALCHEMY_ETHEREUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ETHEREUM_GOERLI_TOKEN" status-im.config/ALCHEMY_ETHEREUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ETHEREUM_SEPOLIA_TOKEN" status-im.config/ALCHEMY_ARBITRUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ARBITRUM_MAINNET_TOKEN" - status-im.config/ALCHEMY_ARBITRUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ARBITRUM_GOERLI_TOKEN" status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN" status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN" - status-im.config/ALCHEMY_OPTIMISM_GOERLI_TOKEN #shadow/env "ALCHEMY_OPTIMISM_GOERLI_TOKEN" status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"} :compiler-options {:output-feature-set :es6 ;;disable for android build as there @@ -146,13 +140,10 @@ status-im.config/RARIBLE_MAINNET_API_KEY #shadow/env "RARIBLE_MAINNET_API_KEY" status-im.config/RARIBLE_TESTNET_API_KEY #shadow/env "RARIBLE_TESTNET_API_KEY" status-im.config/ALCHEMY_ETHEREUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ETHEREUM_MAINNET_TOKEN" - status-im.config/ALCHEMY_ETHEREUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ETHEREUM_GOERLI_TOKEN" status-im.config/ALCHEMY_ETHEREUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ETHEREUM_SEPOLIA_TOKEN" status-im.config/ALCHEMY_ARBITRUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ARBITRUM_MAINNET_TOKEN" - status-im.config/ALCHEMY_ARBITRUM_GOERLI_TOKEN #shadow/env "ALCHEMY_ARBITRUM_GOERLI_TOKEN" status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN" status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN" - status-im.config/ALCHEMY_OPTIMISM_GOERLI_TOKEN #shadow/env "ALCHEMY_OPTIMISM_GOERLI_TOKEN" status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN" status-im.config/WALLET_CONNECT_PROJECT_ID #shadow/env "WALLET_CONNECT_PROJECT_ID"} :compiler-options diff --git a/src/legacy/status_im/ethereum/tokens.cljs b/src/legacy/status_im/ethereum/tokens.cljs index 8959dd8f2c..fe9f1cf067 100644 --- a/src/legacy/status_im/ethereum/tokens.cljs +++ b/src/legacy/status_im/ethereum/tokens.cljs @@ -20,10 +20,6 @@ {:mainnet {:name "Ether" :symbol :ETH :decimals 18} - :goerli {:name "Goerli Ether" - :symbol :ETH - :symbol-display :ETHgo - :decimals 18} :xdai {:name "xDAI" :symbol :ETH :symbol-display :xDAI diff --git a/src/legacy/status_im/ethereum/transactions/core.cljs b/src/legacy/status_im/ethereum/transactions/core.cljs index 631fc44f8a..57039ddfae 100644 --- a/src/legacy/status_im/ethereum/transactions/core.cljs +++ b/src/legacy/status_im/ethereum/transactions/core.cljs @@ -15,12 +15,12 @@ (def etherscan-supported? #{(chain/chain-keyword->chain-id :mainnet) - (chain/chain-keyword->chain-id :goerli)}) + (chain/chain-keyword->chain-id :sepolia)}) (def binance-mainnet-chain-id (chain/chain-keyword->chain-id :bsc)) (def binance-testnet-chain-id (chain/chain-keyword->chain-id :bsc-testnet)) -(def network->subdomain {5 "goerli"}) +(def network->subdomain {11155111 "sepolia"}) (defn get-transaction-details-url [chain-id tx-hash] diff --git a/src/legacy/status_im/ui/screens/advanced_settings/views.cljs b/src/legacy/status_im/ui/screens/advanced_settings/views.cljs index 8f44a38b26..42950880f6 100644 --- a/src/legacy/status_im/ui/screens/advanced_settings/views.cljs +++ b/src/legacy/status_im/ui/screens/advanced_settings/views.cljs @@ -20,7 +20,6 @@ light-client-enabled? current-fleet test-networks-enabled? - is-goerli-enabled? peer-syncing-enabled?]}] (keep identity @@ -85,14 +84,6 @@ #(re-frame/dispatch [:profile.settings/toggle-test-networks]) :accessory :switch :active test-networks-enabled?} - {:size :small - :title "Enable Goerli as test network" - :accessibility-label :enable-sepolia-as-test-network - :container-margin-bottom 8 - :on-press - #(re-frame/dispatch [:profile.settings/toggle-goerli-test-network]) - :accessory :switch - :active is-goerli-enabled?} {:size :small :title "Peer syncing" :accessibility-label :peer-syncing @@ -115,7 +106,6 @@ (views/defview advanced-settings [] (views/letsubs [test-networks-enabled? [:profile/test-networks-enabled?] - is-goerli-enabled? [:profile/is-goerli-enabled?] light-client-enabled? [:profile/light-client-enabled?] telemetry-enabled? [:profile/telemetry-enabled?] current-log-level [:log-level/current-log-level] @@ -136,7 +126,6 @@ :current-fleet current-fleet :dev-mode? false :test-networks-enabled? test-networks-enabled? - :is-goerli-enabled? is-goerli-enabled? :peer-syncing-enabled? peer-syncing-enabled?}) :key-fn (fn [_ i] (str i)) :render-fn render-item}]])) diff --git a/src/status_im/config.cljs b/src/status_im/config.cljs index 89e0022297..11d7c03057 100644 --- a/src/status_im/config.cljs +++ b/src/status_im/config.cljs @@ -16,26 +16,21 @@ (goog-define RARIBLE_MAINNET_API_KEY "") (goog-define RARIBLE_TESTNET_API_KEY "") (goog-define ALCHEMY_ETHEREUM_MAINNET_TOKEN "") -(goog-define ALCHEMY_ETHEREUM_GOERLI_TOKEN "") (goog-define ALCHEMY_ETHEREUM_SEPOLIA_TOKEN "") (goog-define ALCHEMY_ARBITRUM_MAINNET_TOKEN "") -(goog-define ALCHEMY_ARBITRUM_GOERLI_TOKEN "") (goog-define ALCHEMY_ARBITRUM_SEPOLIA_TOKEN "") (goog-define ALCHEMY_OPTIMISM_MAINNET_TOKEN "") -(goog-define ALCHEMY_OPTIMISM_GOERLI_TOKEN "") (goog-define ALCHEMY_OPTIMISM_SEPOLIA_TOKEN "") (goog-define WALLET_CONNECT_PROJECT_ID "87815d72a81d739d2a7ce15c2cfdefb3") (def mainnet-rpc-url (str "https://eth-archival.rpc.grove.city/v1/" POKT_TOKEN)) -(def goerli-rpc-url (str "https://goerli-archival.gateway.pokt.network/v1/lb/" POKT_TOKEN)) +(def sepolia-rpc-url (str "https://sepolia-archival.rpc.grove.city/v1/" POKT_TOKEN)) (def mainnet-chain-explorer-link "https://etherscan.io/address/") (def optimism-mainnet-chain-explorer-link "https://optimistic.etherscan.io/address/") (def arbitrum-mainnet-chain-explorer-link "https://arbiscan.io/address/") (def sepolia-chain-explorer-link "https://sepolia.etherscan.io/address/") (def optimism-sepolia-chain-explorer-link "https://sepolia-optimistic.etherscan.io/address/") (def arbitrum-sepolia-chain-explorer-link "https://sepolia.arbiscan.io/address/") -(def goerli-chain-explorer-link "https://goerli.etherscan.io/address/") -(def optimism-goerli-chain-explorer-link "https://goerli-optimistic.etherscan.io/address/") (def opensea-link "https://opensea.io") (def opensea-tesnet-link "https://testnets.opensea.io") @@ -70,7 +65,7 @@ (def log-level (string/upper-case (get-config :LOG_LEVEL ""))) (def fleet (get-config :FLEET "waku.sandbox")) (def apn-topic (get-config :APN_TOPIC "im.status.ethereum")) -(def default-network (get-config :DEFAULT_NETWORK "goerli_rpc")) +(def default-network (get-config :DEFAULT_NETWORK "sepolia_rpc")) (def max-installations 2) ; currently not supported in status-go (def enable-remove-profile-picture? false) @@ -91,13 +86,13 @@ (def verify-transaction-url (if (= :mainnet (chain/chain-id->chain-keyword verify-transaction-chain-id)) mainnet-rpc-url - goerli-rpc-url)) + sepolia-rpc-url)) (def verify-ens-chain-id (js/parseInt (get-config :VERIFY_ENS_CHAIN_ID "1"))) (def verify-ens-url (if (= :mainnet (chain/chain-id->chain-keyword verify-ens-chain-id)) mainnet-rpc-url - goerli-rpc-url)) + sepolia-rpc-url)) (def verify-ens-contract-address (get-config :VERIFY_ENS_CONTRACT_ADDRESS ((chain/chain-id->chain-keyword verify-ens-chain-id) utils.ens/ens-registries))) diff --git a/src/status_im/constants.cljs b/src/status_im/constants.cljs index 9c0c4f7da1..a0965fa819 100644 --- a/src/status_im/constants.cljs +++ b/src/status_im/constants.cljs @@ -456,30 +456,22 @@ ;; wallet (def ^:const ethereum-mainnet-chain-id 1) -(def ^:const ethereum-goerli-chain-id 5) (def ^:const ethereum-sepolia-chain-id 11155111) (def ^:const arbitrum-mainnet-chain-id 42161) -(def ^:const arbitrum-goerli-chain-id 421613) (def ^:const arbitrum-sepolia-chain-id 421614) (def ^:const optimism-mainnet-chain-id 10) -(def ^:const optimism-goerli-chain-id 420) (def ^:const optimism-sepolia-chain-id 11155420) (def opensea-url-names {:ethereum "ethereum" - :sepolia "sepolia" - :goerli "goerli"}) + :sepolia "sepolia"}) (def ^:const ethereum "ethereum") (def ^:const sepolia "sepolia") -(def ^:const goerli "goerli") (def ^:const mainnet-chain-ids #{ethereum-mainnet-chain-id arbitrum-mainnet-chain-id optimism-mainnet-chain-id}) -(def ^:const goerli-chain-ids - #{ethereum-goerli-chain-id arbitrum-goerli-chain-id optimism-goerli-chain-id}) - (def ^:const sepolia-chain-ids #{ethereum-sepolia-chain-id arbitrum-sepolia-chain-id optimism-sepolia-chain-id}) diff --git a/src/status_im/contexts/profile/config.cljs b/src/status_im/contexts/profile/config.cljs index a19a5728f7..20942af914 100644 --- a/src/status_im/contexts/profile/config.cljs +++ b/src/status_im/contexts/profile/config.cljs @@ -16,13 +16,10 @@ :raribleMainnetAPIKey config/RARIBLE_MAINNET_API_KEY :raribleTestnetAPIKey config/RARIBLE_TESTNET_API_KEY :alchemyEthereumMainnetToken config/ALCHEMY_ETHEREUM_MAINNET_TOKEN - :alchemyEthereumGoerliToken config/ALCHEMY_ETHEREUM_GOERLI_TOKEN :alchemyEthereumSepoliaToken config/ALCHEMY_ETHEREUM_SEPOLIA_TOKEN :alchemyOptimismMainnetToken config/ALCHEMY_OPTIMISM_MAINNET_TOKEN - :alchemyOptimismGoerliToken config/ALCHEMY_OPTIMISM_GOERLI_TOKEN :alchemyOptimismSepoliaToken config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN :alchemyArbitrumMainnetToken config/ALCHEMY_ARBITRUM_MAINNET_TOKEN - :alchemyArbitrumGoerliToken config/ALCHEMY_ARBITRUM_GOERLI_TOKEN :alchemyArbitrumSepoliaToken config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN}) (defn create diff --git a/src/status_im/contexts/profile/settings/events.cljs b/src/status_im/contexts/profile/settings/events.cljs index 6126114e72..020f400edb 100644 --- a/src/status_im/contexts/profile/settings/events.cljs +++ b/src/status_im/contexts/profile/settings/events.cljs @@ -50,17 +50,6 @@ {:on-success on-success}]) :on-cancel nil}]]}))) -(rf/reg-event-fx :profile.settings/toggle-goerli-test-network - (fn [{:keys [db]}] - (let [value (get-in db [:profile/profile :is-goerli-enabled?]) - on-success #(rf/dispatch [:logout])] - {:fx [[:ui/show-confirmation - {:content (i18n/label :t/goerli-testnet-toggle-confirmation) - :on-accept #(rf/dispatch [:profile.settings/profile-update :is-goerli-enabled? - (not value) - {:on-success on-success}]) - :on-cancel nil}]]}))) - (rf/reg-event-fx :profile.settings/change-preview-privacy (fn [_ [private?]] (let [private?' (boolean private?)] diff --git a/src/status_im/contexts/wallet/collectible/events.cljs b/src/status_im/contexts/wallet/collectible/events.cljs index 96e31d99f3..816fd25a8a 100644 --- a/src/status_im/contexts/wallet/collectible/events.cljs +++ b/src/status_im/contexts/wallet/collectible/events.cljs @@ -241,5 +241,4 @@ {:chain-id chain-id :token-id token-id :contract-address contract-address - :test-networks-enabled? (get-in db [:profile/profile :test-networks-enabled?]) - :is-goerli-enabled? (get-in db [:profile/profile :is-goerli-enabled?])})]]]})) + :test-networks-enabled? (get-in db [:profile/profile :test-networks-enabled?])})]]]})) diff --git a/src/status_im/contexts/wallet/collectible/utils.cljs b/src/status_im/contexts/wallet/collectible/utils.cljs index 2688393b9f..3ea7061ea2 100644 --- a/src/status_im/contexts/wallet/collectible/utils.cljs +++ b/src/status_im/contexts/wallet/collectible/utils.cljs @@ -44,17 +44,11 @@ (when (> total 1) (str "x" total))) (defn- get-opensea-network-name - [chain-id test-networks-enabled? is-goerli-enabled?] + [chain-id test-networks-enabled?] (let [network-kw (network-utils/id->network chain-id) network-name (name network-kw) mainnet? (= :mainnet network-kw)] - (cond (and test-networks-enabled? is-goerli-enabled? mainnet?) - (:goerli constants/opensea-url-names) - - (and test-networks-enabled? is-goerli-enabled?) - (str network-name "-" (:goerli constants/opensea-url-names)) - - (and test-networks-enabled? mainnet?) + (cond (and test-networks-enabled? mainnet?) (:sepolia constants/opensea-url-names) test-networks-enabled? @@ -74,9 +68,8 @@ (defn get-opensea-collectible-url [{:keys [chain-id token-id contract-address - test-networks-enabled? is-goerli-enabled?]}] + test-networks-enabled?]}] (let [base-link (get-opensea-base-url test-networks-enabled?) opensea-network-name (get-opensea-network-name chain-id - test-networks-enabled? - is-goerli-enabled?)] + test-networks-enabled?)] (str base-link "/assets/" opensea-network-name "/" contract-address "/" token-id))) diff --git a/src/status_im/contexts/wallet/collectible/utils_test.cljs b/src/status_im/contexts/wallet/collectible/utils_test.cljs index 4be6f5b0fc..39ef120dd1 100644 --- a/src/status_im/contexts/wallet/collectible/utils_test.cljs +++ b/src/status_im/contexts/wallet/collectible/utils_test.cljs @@ -1,8 +1,8 @@ (ns status-im.contexts.wallet.collectible.utils-test (:require - [cljs.test :refer [deftest is testing]] - [status-im.constants :as constants] - [status-im.contexts.wallet.collectible.utils :as utils])) + [cljs.test :refer [deftest is testing]] + [status-im.constants :as constants] + [status-im.contexts.wallet.collectible.utils :as utils])) (def token-id "0xT") (def contract-address "0xC") @@ -43,26 +43,4 @@ :contract-address contract-address :token-id token-id :test-networks-enabled? true}) - "https://testnets.opensea.io/assets/optimism-sepolia/0xC/0xT"))) - (testing "get-opensea-collectible-url goerli" - (is (= (utils/get-opensea-collectible-url {:chain-id constants/ethereum-goerli-chain-id - :contract-address contract-address - :token-id token-id - :test-networks-enabled? true - :is-goerli-enabled? true}) - "https://testnets.opensea.io/assets/goerli/0xC/0xT"))) - (testing "get-opensea-collectible-url goerli arbitrum" - (is (= (utils/get-opensea-collectible-url {:chain-id constants/arbitrum-goerli-chain-id - :contract-address contract-address - :token-id token-id - :test-networks-enabled? true - :is-goerli-enabled? true}) - "https://testnets.opensea.io/assets/arbitrum-goerli/0xC/0xT"))) - - (testing "get-opensea-collectible-url goerli optimism" - (is (= (utils/get-opensea-collectible-url {:chain-id constants/optimism-goerli-chain-id - :contract-address contract-address - :token-id token-id - :test-networks-enabled? true - :is-goerli-enabled? true}) - "https://testnets.opensea.io/assets/optimism-goerli/0xC/0xT")))) + "https://testnets.opensea.io/assets/optimism-sepolia/0xC/0xT")))) diff --git a/src/status_im/contexts/wallet/common/utils/external_links.cljs b/src/status_im/contexts/wallet/common/utils/external_links.cljs index 6b2a601765..5cc21485ea 100644 --- a/src/status_im/contexts/wallet/common/utils/external_links.cljs +++ b/src/status_im/contexts/wallet/common/utils/external_links.cljs @@ -14,12 +14,6 @@ (= chain-id constants/optimism-mainnet-chain-id) config/optimism-mainnet-chain-explorer-link - (= chain-id constants/ethereum-goerli-chain-id) - config/goerli-chain-explorer-link - - (= chain-id constants/optimism-goerli-chain-id) - config/optimism-goerli-chain-explorer-link - (= chain-id constants/ethereum-sepolia-chain-id) config/sepolia-chain-explorer-link diff --git a/src/status_im/contexts/wallet/common/utils/networks.cljs b/src/status_im/contexts/wallet/common/utils/networks.cljs index ad20445e0b..4adbd8c9cf 100644 --- a/src/status_im/contexts/wallet/common/utils/networks.cljs +++ b/src/status_im/contexts/wallet/common/utils/networks.cljs @@ -8,58 +8,42 @@ (def id->network {constants/ethereum-mainnet-chain-id constants/mainnet-network-name - constants/ethereum-goerli-chain-id constants/mainnet-network-name constants/ethereum-sepolia-chain-id constants/mainnet-network-name constants/optimism-mainnet-chain-id constants/optimism-network-name - constants/optimism-goerli-chain-id constants/optimism-network-name constants/optimism-sepolia-chain-id constants/optimism-network-name constants/arbitrum-mainnet-chain-id constants/arbitrum-network-name - constants/arbitrum-goerli-chain-id constants/arbitrum-network-name constants/arbitrum-sepolia-chain-id constants/arbitrum-network-name}) (defn- get-chain-id - [{:keys [mainnet-chain-id sepolia-chain-id goerli-chain-id testnet-enabled? goerli-enabled?]}] - (cond - (and testnet-enabled? goerli-enabled?) - goerli-chain-id - - testnet-enabled? + [{:keys [mainnet-chain-id sepolia-chain-id testnet-enabled?]}] + (if testnet-enabled? sepolia-chain-id - - :else mainnet-chain-id)) (defn network->chain-id ([db network] - (let [{:keys [test-networks-enabled? is-goerli-enabled?]} (:profile/profile db)] + (let [{:keys [test-networks-enabled?]} (:profile/profile db)] (network->chain-id {:network network - :testnet-enabled? test-networks-enabled? - :goerli-enabled? is-goerli-enabled?}))) - ([{:keys [network testnet-enabled? goerli-enabled?]}] + :testnet-enabled? test-networks-enabled?}))) + ([{:keys [network testnet-enabled?]}] (condp contains? (keyword network) #{constants/mainnet-network-name (keyword constants/mainnet-short-name)} (get-chain-id {:mainnet-chain-id constants/ethereum-mainnet-chain-id :sepolia-chain-id constants/ethereum-sepolia-chain-id - :goerli-chain-id constants/ethereum-goerli-chain-id - :testnet-enabled? testnet-enabled? - :goerli-enabled? goerli-enabled?}) + :testnet-enabled? testnet-enabled?}) #{constants/optimism-network-name (keyword constants/optimism-short-name)} (get-chain-id {:mainnet-chain-id constants/optimism-mainnet-chain-id :sepolia-chain-id constants/optimism-sepolia-chain-id - :goerli-chain-id constants/optimism-goerli-chain-id - :testnet-enabled? testnet-enabled? - :goerli-enabled? goerli-enabled?}) + :testnet-enabled? testnet-enabled?}) #{constants/arbitrum-network-name (keyword constants/arbitrum-short-name)} (get-chain-id {:mainnet-chain-id constants/arbitrum-mainnet-chain-id :sepolia-chain-id constants/arbitrum-sepolia-chain-id - :goerli-chain-id constants/arbitrum-goerli-chain-id - :testnet-enabled? testnet-enabled? - :goerli-enabled? goerli-enabled?})))) + :testnet-enabled? testnet-enabled?})))) (defn network-list [{:keys [balances-per-chain]} networks] @@ -71,19 +55,13 @@ (keys balances-per-chain)))) (defn get-default-chain-ids-by-mode - [{:keys [test-networks-enabled? is-goerli-enabled?]}] - (cond - (and test-networks-enabled? is-goerli-enabled?) - constants/goerli-chain-ids - - test-networks-enabled? + [{:keys [test-networks-enabled?]}] + (if test-networks-enabled? constants/sepolia-chain-ids - - :else constants/mainnet-chain-ids)) (defn resolve-receiver-networks - [{:keys [prefix testnet-enabled? goerli-enabled?]}] + [{:keys [prefix testnet-enabled?]}] (let [prefix (if (string/blank? prefix) constants/default-multichain-address-prefix prefix) @@ -93,8 +71,7 @@ (mapv #(network->chain-id {:network % - :testnet-enabled? testnet-enabled? - :goerli-enabled? goerli-enabled?}))))) + :testnet-enabled? testnet-enabled?}))))) (def network->short-name {constants/mainnet-network-name constants/mainnet-short-name diff --git a/src/status_im/contexts/wallet/common/utils/networks_test.cljs b/src/status_im/contexts/wallet/common/utils/networks_test.cljs index 7c719b76c7..2dd924cccf 100644 --- a/src/status_im/contexts/wallet/common/utils/networks_test.cljs +++ b/src/status_im/contexts/wallet/common/utils/networks_test.cljs @@ -6,19 +6,17 @@ (deftest network->chain-id-test (testing "network->chain-id function" - (is (= (utils/network->chain-id {:network :mainnet :testnet-enabled? false :goerli-enabled? false}) + (is (= (utils/network->chain-id {:network :mainnet :testnet-enabled? false}) constants/ethereum-mainnet-chain-id)) - (is (= (utils/network->chain-id {:network :eth :testnet-enabled? true :goerli-enabled? false}) + (is (= (utils/network->chain-id {:network :eth :testnet-enabled? true }) constants/ethereum-sepolia-chain-id)) - (is (= (utils/network->chain-id {:network "optimism" :testnet-enabled? true :goerli-enabled? false}) + (is (= (utils/network->chain-id {:network "optimism" :testnet-enabled? true}) constants/optimism-sepolia-chain-id)) - (is (= (utils/network->chain-id {:network "oeth" :testnet-enabled? false :goerli-enabled? true}) + (is (= (utils/network->chain-id {:network "oeth" :testnet-enabled? false}) constants/optimism-mainnet-chain-id)) - (is (= (utils/network->chain-id {:network :oeth :testnet-enabled? true :goerli-enabled? true}) - constants/optimism-goerli-chain-id)) - (is (= (utils/network->chain-id {:network :arb1 :testnet-enabled? false :goerli-enabled? false}) + (is (= (utils/network->chain-id {:network :arb1 :testnet-enabled? false}) constants/arbitrum-mainnet-chain-id)) - (is (= (utils/network->chain-id {:network :arbitrum :testnet-enabled? true :goerli-enabled? false}) + (is (= (utils/network->chain-id {:network :arbitrum :testnet-enabled? true}) constants/arbitrum-sepolia-chain-id)))) (deftest short-names->network-preference-prefix-test diff --git a/src/status_im/contexts/wallet/events.cljs b/src/status_im/contexts/wallet/events.cljs index 8eb78a1f81..00b62fa0c8 100644 --- a/src/status_im/contexts/wallet/events.cljs +++ b/src/status_im/contexts/wallet/events.cljs @@ -444,10 +444,8 @@ (for [[k v] chains :when (= v "down")] k)) keys) test-networks-enabled? (get-in db [:profile/profile :test-networks-enabled?]) - is-goerli-enabled? (get-in db [:profile/profile :is-goerli-enabled?]) chain-ids-by-mode (network-utils/get-default-chain-ids-by-mode - {:test-networks-enabled? test-networks-enabled? - :is-goerli-enabled? is-goerli-enabled?}) + {:test-networks-enabled? test-networks-enabled?}) chains-filtered-by-mode (remove #(not (contains? chain-ids-by-mode %)) down-chain-ids) chains-down? (seq chains-filtered-by-mode) chain-names (when chains-down? @@ -459,8 +457,7 @@ (string/join ", ")))] (when (seq down-chain-ids) (log/info "[wallet] Chain(s) down: " down-chain-ids) - (log/info "[wallet] Test network enabled: " (boolean test-networks-enabled?)) - (log/info "[wallet] Goerli network enabled: " (boolean is-goerli-enabled?))) + (log/info "[wallet] Test network enabled: " (boolean test-networks-enabled?))) {:db (assoc-in db [:wallet :statuses :blockchains] chains) :fx [(when chains-down? [:dispatch diff --git a/src/status_im/subs/profile.cljs b/src/status_im/subs/profile.cljs index 0730eb732e..308ef38d91 100644 --- a/src/status_im/subs/profile.cljs +++ b/src/status_im/subs/profile.cljs @@ -105,12 +105,6 @@ (fn [profile] (:universal-profile-url profile))) -(re-frame/reg-sub - :profile/is-goerli-enabled? - :<- [:profile/profile] - (fn [profile] - (:is-goerli-enabled? profile))) - (re-frame/reg-sub :profile/peer-syncing-enabled? :<- [:profile/profile] diff --git a/src/status_im/subs/wallet/wallet.cljs b/src/status_im/subs/wallet/wallet.cljs index e481c1c7fb..2b994a616c 100644 --- a/src/status_im/subs/wallet/wallet.cljs +++ b/src/status_im/subs/wallet/wallet.cljs @@ -235,12 +235,10 @@ :wallet/selected-networks->chain-ids :<- [:wallet/selected-networks] :<- [:profile/test-networks-enabled?] - :<- [:profile/is-goerli-enabled?] - (fn [[selected-networks testnet-enabled? goerli-enabled?]] + (fn [[selected-networks testnet-enabled?]] (set (map #(network-utils/network->chain-id {:network % - :testnet-enabled? testnet-enabled? - :goerli-enabled? goerli-enabled?}) + :testnet-enabled? testnet-enabled?}) selected-networks)))) (defn- format-settings-keypair-accounts diff --git a/src/tests/contract_test/wallet_test.cljs b/src/tests/contract_test/wallet_test.cljs index a7a0e3a4db..2170478588 100644 --- a/src/tests/contract_test/wallet_test.cljs +++ b/src/tests/contract_test/wallet_test.cljs @@ -110,25 +110,3 @@ [expected-result actual-result] (is (= expected-result actual-result))) -#_(deftest wallet-search-ens-test - (h/test-async :wallet/search-ens - (fn [] - (promesa/let [_ (h/enable-testnet!)] - (let [test-cases [{:description "Test on Ethereum mainnet" - :ens-name "test.eth" - :chain-id constants/ethereum-mainnet-chain-id - :expected-result "0xeefb13c7d42efcc655e528da6d6f7bbcf9a2251d"} - {:description "Test on Goerli testnet" - :ens-name "qoqobolo.stateofus.eth" - :chain-id constants/ethereum-goerli-chain-id - :expected-result "0xf8f4f6b5c73f4fb561eb2676326d81b7aba180b0"} - {:description "Test on Sepolia testnet" - :ens-name "code.eth" - :chain-id constants/ethereum-sepolia-chain-id - :expected-result "0x035ebd096afa6b98372494c7f08f3402324117d3"}]] - (promesa/all - (map (fn [{:keys [ens-name chain-id expected-result]}] - (promesa/let [ens-address - (contract-utils/call-rpc "ens_addressOf" chain-id ens-name)] - (assert-search-ens expected-result ens-address))) - test-cases))))))) diff --git a/src/utils/ens/core.cljs b/src/utils/ens/core.cljs index 7977240619..3a6551bc2f 100644 --- a/src/utils/ens/core.cljs +++ b/src/utils/ens/core.cljs @@ -4,7 +4,7 @@ ;; this is the addresses of ens registries for the different networks (def ens-registries {:mainnet "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" - :goerli "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"}) + :sepolia "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"}) (def default-address "0x0000000000000000000000000000000000000000") (def default-key diff --git a/src/utils/ens/stateofus.cljs b/src/utils/ens/stateofus.cljs index 1912b57700..d27e5299ff 100644 --- a/src/utils/ens/stateofus.cljs +++ b/src/utils/ens/stateofus.cljs @@ -26,15 +26,6 @@ (when (and name (string/ends-with? name domain)) (first (string/split name ".")))) -(def old-registrars - (merge - {:mainnet "0xDB5ac1a559b02E12F29fC0eC0e37Be8E046DEF49" - :goerli "0xD1f7416F91E7Eb93dD96A61F12FC092aD6B67B11"})) - -(defn get-cached-registrar - [chain] - (get old-registrars chain)) - (defn lower-case? [s] (when s diff --git a/src/utils/ethereum/chain.cljs b/src/utils/ethereum/chain.cljs index 9951240426..90154fde6b 100644 --- a/src/utils/ethereum/chain.cljs +++ b/src/utils/ethereum/chain.cljs @@ -7,7 +7,6 @@ (def chains {:mainnet {:id 1 :name "Mainnet"} :xdai {:id 100 :name "xDai"} - :goerli {:id 5 :name "Goerli"} :bsc {:id BSC-mainnet-chain-id :name "BSC"} :bsc-testnet {:id BSC-testnet-chain-id @@ -35,12 +34,6 @@ :mainnet :SNT :STT)) -(defn testnet? - [id] - (contains? #{(chain-keyword->chain-id :goerli) - (chain-keyword->chain-id :bsc-testnet)} - id)) - (defn network->chain-id [network] (get-in network [:config :NetworkId])) diff --git a/src/utils/ethereum/chain_test.cljs b/src/utils/ethereum/chain_test.cljs index 2f5de9cf20..7ae752ca77 100644 --- a/src/utils/ethereum/chain_test.cljs +++ b/src/utils/ethereum/chain_test.cljs @@ -7,17 +7,15 @@ [test-networks-enabled?] {:profile/profile {:test-networks-enabled? test-networks-enabled?} :wallet {:networks {:test [{:chain-id 3} - {:chain-id 4} - {:chain-id 5}] + {:chain-id 4}] :prod [{:chain-id 1} {:chain-id 42161} {:chain-id 10}]}}}) (deftest chain-id->chain-keyword-test (is (= (chain/chain-id->chain-keyword 1) :mainnet)) - (is (= (chain/chain-id->chain-keyword 5) :goerli)) (is (= (chain/chain-id->chain-keyword 5777) :custom))) (deftest chain-ids-test (is (= (chain/chain-ids (chain-ids-db false)) [1 42161 10])) - (is (= (chain/chain-ids (chain-ids-db true)) [3 4 5]))) + (is (= (chain/chain-ids (chain-ids-db true)) [3 4]))) diff --git a/src/utils/ethereum/eip/eip681_test.cljs b/src/utils/ethereum/eip/eip681_test.cljs index 55a67640bd..6b53a00b01 100644 --- a/src/utils/ethereum/eip/eip681_test.cljs +++ b/src/utils/ethereum/eip/eip681_test.cljs @@ -105,19 +105,6 @@ :function-name "transfer" :function-arguments {:address "gimme.eth" :uint256 "1"}}))) -(def all-tokens - {:mainnet {"0x744d70fdbe2ba4cf95131626614a1763df805b9e" {:address - "0x744d70fdbe2ba4cf95131626614a1763df805b9e" - :name "Status Network Token" - :symbol :SNT - :decimals 18}} - :goerli {"0x3d6afaa395c31fcd391fe3d562e75fe9e8ec7e6a" - {:address - "0x3d6afaa395c31fcd391fe3d562e75fe9e8ec7e6a" - :name "Status Test Token" - :symbol :STT - :decimals 18}}}) - (deftest generate-uri-test (is (= nil (eip681/generate-uri nil nil))) (is (= "ethereum:0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7" diff --git a/translations/en.json b/translations/en.json index c3702cf6ac..fb393f4f24 100644 --- a/translations/en.json +++ b/translations/en.json @@ -2624,7 +2624,6 @@ "keypair-name-input-placeholder": "Collectibles key pair, Old vault....", "key-pair-name-updated": "Key pair name updated", "key-pair-removed": "Key pair and derived accounts has been removed", - "goerli-testnet-toggle-confirmation": "Are you sure you want to toggle Goerli? This will log you out and you will have to login again.", "sepolia-active": "Sepolia active", "testnet-not-available": "Testnet not available", "bridged-to": "Bridged to {{network}}",