Skip to content

Commit

Permalink
[#9061] fix fetching balances for keycard acc
Browse files Browse the repository at this point in the history
  • Loading branch information
rasom committed Oct 31, 2019
1 parent f7cc74a commit 15ea5f5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/status_im/multiaccounts/login/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
[status-im.wallet.core :as wallet]
[taoensso.timbre :as log]
[status-im.ui.screens.db :refer [app-db]]
[status-im.multiaccounts.biometric.core :as biometric]))
[status-im.multiaccounts.biometric.core :as biometric]
[status-im.ethereum.eip55 :as eip55]))

(def rpc-endpoint "https://goerli.infura.io/v3/f315575765b14720b32382a61a89341a")
(def contract-address "0xfbf4c8e2B41fAfF8c616a0E49Fb4365a5355Ffaf")
Expand Down Expand Up @@ -128,6 +129,16 @@
current-network
(types/deserialize networks)])

(defn convert-multiaccounts-addresses
[multiaccount]
(-> multiaccount
(update :address eip55/address->checksum)
(update :accounts
(fn [accounts]
(mapv
#(update % :address eip55/address->checksum)
accounts)))))

(fx/defn get-config-callback
{:events [::get-config-callback]}
[{:keys [db] :as cofx} config]
Expand All @@ -137,7 +148,8 @@
{:db (assoc db
:networks/current-network current-network
:networks/networks networks
:multiaccount multiaccount)}
:multiaccount (convert-multiaccounts-addresses
multiaccount))}
;; NOTE: initializing mailserver depends on user mailserver
;; preference which is why we wait for config callback
(protocol/initialize-protocol {:default-mailserver true})
Expand Down

0 comments on commit 15ea5f5

Please sign in to comment.