From 77cb0c2f3da4d7b3ecfce75ae6dafb677f46ea29 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Wed, 13 Jun 2018 11:56:52 +0300 Subject: [PATCH] [#4671 #4708] mainnet_rpc as default network, no mainnet warning Signed-off-by: Andrea Maria Piana --- .env | 1 - .env.e2e | 1 - .env.jenkins | 1 - .env.nightly | 1 - .env.prod | 2 +- src/status_im/translations/en.cljs | 4 ---- .../ui/screens/network_settings/views.cljs | 17 ++--------------- src/status_im/utils/config.cljs | 1 - 8 files changed, 3 insertions(+), 25 deletions(-) diff --git a/.env b/.env index ba73b89daa..2960d2ebb4 100644 --- a/.env +++ b/.env @@ -1,7 +1,6 @@ TESTFAIRY_ENABLED=0 STUB_STATUS_GO=0 ETHEREUM_DEV_CLUSTER=1 -MAINNET_WARNING_ENABLED=0 OFFLINE_INBOX_ENABLED=1 RPC_NETWORKS_ONLY=1 LOG_LEVEL=debug diff --git a/.env.e2e b/.env.e2e index b7e6b7b950..dfdcecb257 100644 --- a/.env.e2e +++ b/.env.e2e @@ -1,7 +1,6 @@ TESTFAIRY_ENABLED=1 STUB_STATUS_GO=0 ETHEREUM_DEV_CLUSTER=1 -MAINNET_WARNING_ENABLED=0 OFFLINE_INBOX_ENABLED=1 LOG_LEVEL=debug LOG_LEVEL_STATUS_GO=info diff --git a/.env.jenkins b/.env.jenkins index 1bf97f4fc6..850f5e212d 100644 --- a/.env.jenkins +++ b/.env.jenkins @@ -1,7 +1,6 @@ TESTFAIRY_ENABLED=1 STUB_STATUS_GO=0 ETHEREUM_DEV_CLUSTER=1 -MAINNET_WARNING_ENABLED=0 OFFLINE_INBOX_ENABLED=1 LOG_LEVEL=debug LOG_LEVEL_STATUS_GO=info diff --git a/.env.nightly b/.env.nightly index 1ce62e0157..f520cf5fd4 100644 --- a/.env.nightly +++ b/.env.nightly @@ -1,7 +1,6 @@ TESTFAIRY_ENABLED=1 STUB_STATUS_GO=0 ETHEREUM_DEV_CLUSTER=1 -MAINNET_NETWORKS_ENABLED=1 OFFLINE_INBOX_ENABLED=1 LOG_LEVEL=debug LOG_LEVEL_STATUS_GO=info diff --git a/.env.prod b/.env.prod index eabdf0fa1a..c9f3b81c54 100644 --- a/.env.prod +++ b/.env.prod @@ -11,7 +11,7 @@ RN_BRIDGE_THRESHOLD_WARNINGS=0 POW_TARGET=0.002 POW_TIME=1 MIXPANEL_TOKEN=2584e00100d319d12e538cc4d0fa9fc1 -DEFAULT_NETWORK=testnet_rpc +DEFAULT_NETWORK=mainnet_rpc TESTFAIRY_TOKEN=969f6c921cb435cea1d41d1ea3f5b247d6026d55 INSTABUG_TOKEN=758630ed52864cbad9c5eeeac596c60c DEBUG_WEBVIEW=0 diff --git a/src/status_im/translations/en.cljs b/src/status_im/translations/en.cljs index 8c20ce3663..7d5110f687 100644 --- a/src/status_im/translations/en.cljs +++ b/src/status_im/translations/en.cljs @@ -669,10 +669,6 @@ :delete-bootnode-are-you-sure "Are you sure you want to delete this bootnode?" :delete-bootnode "Delete bootnode" - :mainnet-warning-title "Warning!" - :mainnet-warning-text "While we highly appreciate your contribution as a tester of Status, we’d like to point out the dangers. You’re switching to Mainnet mode which is still in Alpha. This means it is still in development and has not been audited yet. Some of the risks you may be exposed to include:\n\n- Accounts may be unrecoverable due to breaking changes\n- Loss of ETH and tokens\n- Failure to send or receive messages\n\nSwitching to Mainnet should be done for testing purposes only. By tapping \"I understand\", you confirm that you assume the full responsibility for all risks concerning your data and funds. " - :mainnet-warning-ok-text "I understand" - :main-networks "Main networks" :test-networks "Test networks" :custom-networks "Custom networks" diff --git a/src/status_im/ui/screens/network_settings/views.cljs b/src/status_im/ui/screens/network_settings/views.cljs index 1278870db5..7483ce4627 100644 --- a/src/status_im/ui/screens/network_settings/views.cljs +++ b/src/status_im/ui/screens/network_settings/views.cljs @@ -10,10 +10,7 @@ [status-im.ui.components.toolbar.view :as toolbar] [status-im.ui.components.toolbar.actions :as toolbar.actions] [status-im.ui.components.styles :as components.styles] - [status-im.ui.components.common.common :as components.common] - [status-im.ui.screens.network-settings.styles :as styles] - [status-im.utils.utils :as utils] - [status-im.utils.config :as config])) + [status-im.ui.screens.network-settings.styles :as styles])) (defn- network-icon [connected? size] [react/view (styles/network-icon connected? size) @@ -38,20 +35,10 @@ (defn navigate-to-add-network [] (re-frame/dispatch [:edit-network])) -(defn wrap-mainnet-warning [network cb] - (fn [] - (if (and config/mainnet-warning-enabled? - (mainnet? (:id network))) - (utils/show-confirmation (i18n/label :t/mainnet-warning-title) - (i18n/label :t/mainnet-warning-text) - (i18n/label :t/mainnet-warning-ok-text) - #(cb network)) - (cb network)))) - (defn render-network [current-network] (fn [{:keys [id name] :as network}] (let [connected? (= id current-network)] - [list/touchable-item (wrap-mainnet-warning network navigate-to-network) + [list/touchable-item #(navigate-to-network network) [react/view styles/network-item [network-icon connected? 40] [react/view {:padding-horizontal 16} diff --git a/src/status_im/utils/config.cljs b/src/status_im/utils/config.cljs index 0191fba8b3..e032363b0b 100644 --- a/src/status_im/utils/config.cljs +++ b/src/status_im/utils/config.cljs @@ -20,7 +20,6 @@ (def testfairy-enabled? (enabled? (get-config :TESTFAIRY_ENABLED))) (def stub-status-go? (enabled? (get-config :STUB_STATUS_GO 0))) -(def mainnet-warning-enabled? (enabled? (get-config :MAINNET_WARNING_ENABLED 0))) (def offline-inbox-enabled? (enabled? (get-config :OFFLINE_INBOX_ENABLED "1"))) (def bootnodes-settings-enabled? (enabled? (get-config :BOOTNODES_SETTINGS_ENABLED "1"))) (def log-level