chore: remove goerli network

This commit is contained in:
Jamie Caprani 2024-05-30 16:16:50 +01:00
parent 1ee44259c4
commit d76de170ab
No known key found for this signature in database
GPG Key ID: 76A2A47D4CD8B428
28 changed files with 49 additions and 229 deletions

View File

@ -1,5 +1,5 @@
DEBUG_WEBVIEW=1
DEFAULT_NETWORK=goerli_rpc
DEFAULT_NETWORK=
ETHEREUM_DEV_CLUSTER=1
EXTENSIONS=0
FLEET=status.prod

View File

@ -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. Thats 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. Thats 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

View File

@ -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];

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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]

View File

@ -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}]]))

View File

@ -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)))

View File

@ -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})

View File

@ -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

View File

@ -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?)]

View File

@ -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?])})]]]}))

View File

@ -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)))

View File

@ -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"))))

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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]

View File

@ -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

View File

@ -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)))))))

View File

@ -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

View File

@ -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

View File

@ -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]))

View File

@ -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])))

View File

@ -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"

View File

@ -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}}",