App crashes after sync #19655 (#19763)

This commit is contained in:
flexsurfer 2024-04-23 15:28:35 +02:00 committed by GitHub
parent 54b2e0e678
commit 6b5c807176
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 35 deletions

View File

@ -3,7 +3,8 @@
[clojure.string :as string] [clojure.string :as string]
[legacy.status-im.utils.deprecated-types :as types] [legacy.status-im.utils.deprecated-types :as types]
[react-native.platform :as platform] [react-native.platform :as platform]
[status-im.config :as config])) [status-im.config :as config]
[utils.ethereum.chain :as chain]))
(defn- add-log-level (defn- add-log-level
[config log-level] [config log-level]
@ -105,7 +106,7 @@
(some #(string/includes? (str %) "waku") ks))) (some #(string/includes? (str %) "waku") ks)))
(defn get-multiaccount-node-config (defn get-multiaccount-node-config
[{:keys [profile/profile :networks/networks :networks/current-network] [{:keys [profile/profile :networks/current-network]
:as db}] :as db}]
(let [wakuv2-config (get profile :wakuv2-config {}) (let [wakuv2-config (get profile :wakuv2-config {})
fleet-key (current-fleet-key db) fleet-key (current-fleet-key db)
@ -116,7 +117,10 @@
{:keys [installation-id log-level {:keys [installation-id log-level
waku-bloom-filter-mode]} waku-bloom-filter-mode]}
profile] 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 :always
(get-base-node-config) (get-base-node-config)
@ -173,5 +177,3 @@
:always :always
(add-log-level log-level)))) (add-log-level log-level))))

View File

@ -6,7 +6,6 @@
[status-im.contexts.chat.contacts.events :as data-store.contacts] [status-im.contexts.chat.contacts.events :as data-store.contacts]
status-im.contexts.chat.home.add-new-contact.effects status-im.contexts.chat.home.add-new-contact.effects
[utils.ens.stateofus :as stateofus] [utils.ens.stateofus :as stateofus]
[utils.ethereum.chain :as chain]
[utils.string :as utils.string])) [utils.string :as utils.string]))
(defn init-contact (defn init-contact
@ -115,8 +114,7 @@
:failure-fn failure-fn}])}} :failure-fn failure-fn}])}}
:resolve-ens {:db (assoc db :contacts/new-identity contact) :resolve-ens {:db (assoc db :contacts/new-identity contact)
:effects.contacts/resolve-public-key-from-ens :effects.contacts/resolve-public-key-from-ens
{:chain-id (chain/chain-id db) {:ens ens
:ens ens
:on-success :on-success
#(re-frame/dispatch [:contacts/set-new-identity-success #(re-frame/dispatch [:contacts/set-new-identity-success
{:input input {:input input

View File

@ -85,10 +85,7 @@
(def db (def db
{:profile/profile {:public-key user-ukey} {:profile/profile {:public-key user-ukey}
:networks/current-network "mainnet_rpc" :networks/current-network "mainnet_rpc"})
:networks/networks {"mainnet_rpc"
{:id "mainnet_rpc"
:config {:NetworkId 1}}}})
(deftest set-new-identity-test (deftest set-new-identity-test
(with-redefs [re-frame/dispatch (fn [& args] args)] (with-redefs [re-frame/dispatch (fn [& args] args)]
@ -120,8 +117,7 @@
:scanned ens :scanned ens
:state :resolve-ens})) :state :resolve-ens}))
:effects.contacts/resolve-public-key-from-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-success [:contacts/set-new-identity-success ens]
:on-error [:contacts/set-new-identity-error ens]}} :on-error [:contacts/set-new-identity-error ens]}}

View File

@ -53,7 +53,6 @@
:wallet-root-address "0x704c9a261b918cb8e522f7fc2bc477c12d0c74ac" :wallet-root-address "0x704c9a261b918cb8e522f7fc2bc477c12d0c74ac"
:last-backup 1701832050 :last-backup 1701832050
:link-previews-enabled-sites #{} :link-previews-enabled-sites #{}
:networks/networks {}
:wakuv2-config {:Port 0 :wakuv2-config {:Port 0
:DataDir "" :DataDir ""
:LightClient true :LightClient true

View File

@ -49,24 +49,6 @@
[network] [network]
(chain-id->chain-keyword (network->chain-id 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 (defn network->chain-name
[network] [network]
(-> network (-> network
@ -74,8 +56,8 @@
name)) name))
(defn get-current-network (defn get-current-network
[m] [_]
(get (:networks/networks m) (:networks/current-network m))) nil)
(defn chain-keyword (defn chain-keyword
[db] [db]