diff --git a/src/legacy/status_im/node/core.cljs b/src/legacy/status_im/node/core.cljs index 61f2f75216..e7518df278 100644 --- a/src/legacy/status_im/node/core.cljs +++ b/src/legacy/status_im/node/core.cljs @@ -3,7 +3,8 @@ [clojure.string :as string] [legacy.status-im.utils.deprecated-types :as types] [react-native.platform :as platform] - [status-im.config :as config])) + [status-im.config :as config] + [utils.ethereum.chain :as chain])) (defn- add-log-level [config log-level] @@ -105,7 +106,7 @@ (some #(string/includes? (str %) "waku") ks))) (defn get-multiaccount-node-config - [{:keys [profile/profile :networks/networks :networks/current-network] + [{:keys [profile/profile :networks/current-network] :as db}] (let [wakuv2-config (get profile :wakuv2-config {}) fleet-key (current-fleet-key db) @@ -116,7 +117,10 @@ {:keys [installation-id log-level waku-bloom-filter-mode]} profile] - (cond-> (get-in networks [current-network :config]) + (cond-> {:NetworkId (chain/chain-keyword->chain-id :mainnet) + :DataDir "/ethereum/mainnet_rpc" + :UpstreamConfig {:Enabled true + :URL config/mainnet-rpc-url}} :always (get-base-node-config) @@ -173,5 +177,3 @@ :always (add-log-level log-level)))) - - diff --git a/src/status_im/contexts/chat/home/add_new_contact/events.cljs b/src/status_im/contexts/chat/home/add_new_contact/events.cljs index 49a7a07087..c1b6dfe3c4 100644 --- a/src/status_im/contexts/chat/home/add_new_contact/events.cljs +++ b/src/status_im/contexts/chat/home/add_new_contact/events.cljs @@ -6,7 +6,6 @@ [status-im.contexts.chat.contacts.events :as data-store.contacts] status-im.contexts.chat.home.add-new-contact.effects [utils.ens.stateofus :as stateofus] - [utils.ethereum.chain :as chain] [utils.string :as utils.string])) (defn init-contact @@ -115,8 +114,7 @@ :failure-fn failure-fn}])}} :resolve-ens {:db (assoc db :contacts/new-identity contact) :effects.contacts/resolve-public-key-from-ens - {:chain-id (chain/chain-id db) - :ens ens + {:ens ens :on-success #(re-frame/dispatch [:contacts/set-new-identity-success {:input input diff --git a/src/status_im/contexts/chat/home/add_new_contact/events_test.cljs b/src/status_im/contexts/chat/home/add_new_contact/events_test.cljs index cd68a70945..320ba17beb 100644 --- a/src/status_im/contexts/chat/home/add_new_contact/events_test.cljs +++ b/src/status_im/contexts/chat/home/add_new_contact/events_test.cljs @@ -85,10 +85,7 @@ (def db {:profile/profile {:public-key user-ukey} - :networks/current-network "mainnet_rpc" - :networks/networks {"mainnet_rpc" - {:id "mainnet_rpc" - :config {:NetworkId 1}}}}) + :networks/current-network "mainnet_rpc"}) (deftest set-new-identity-test (with-redefs [re-frame/dispatch (fn [& args] args)] @@ -120,8 +117,7 @@ :scanned ens :state :resolve-ens})) :effects.contacts/resolve-public-key-from-ens - {:chain-id 1 - :ens ens-stateofus-eth + {:ens ens-stateofus-eth :on-success [:contacts/set-new-identity-success ens] :on-error [:contacts/set-new-identity-error ens]}} diff --git a/src/status_im/subs/profile_test.cljs b/src/status_im/subs/profile_test.cljs index 818512712a..9b4b431e3f 100644 --- a/src/status_im/subs/profile_test.cljs +++ b/src/status_im/subs/profile_test.cljs @@ -53,7 +53,6 @@ :wallet-root-address "0x704c9a261b918cb8e522f7fc2bc477c12d0c74ac" :last-backup 1701832050 :link-previews-enabled-sites #{} - :networks/networks {} :wakuv2-config {:Port 0 :DataDir "" :LightClient true diff --git a/src/utils/ethereum/chain.cljs b/src/utils/ethereum/chain.cljs index a150cb5d71..9951240426 100644 --- a/src/utils/ethereum/chain.cljs +++ b/src/utils/ethereum/chain.cljs @@ -49,24 +49,6 @@ [network] (chain-id->chain-keyword (network->chain-id network))) -(defn binance-chain-id? - [chain-id] - (or (= BSC-mainnet-chain-id chain-id) - (= BSC-testnet-chain-id chain-id))) - -(defn current-network - [db] - (let [networks (get db :networks/networks) - network-id (get db :networks/current-network)] - (get networks network-id))) - -(defn binance-chain? - [db] - (-> db - current-network - network->chain-id - binance-chain-id?)) - (defn network->chain-name [network] (-> network @@ -74,8 +56,8 @@ name)) (defn get-current-network - [m] - (get (:networks/networks m) (:networks/current-network m))) + [_] + nil) (defn chain-keyword [db]