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

View File

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

View File

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

View File

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

View File

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