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 29, 2019
1 parent 0856ae1 commit de786b6
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/status_im/multiaccounts/login/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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 @@ -129,6 +130,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 stored-pns]
Expand All @@ -138,7 +149,8 @@
{:db (assoc db
:networks/current-network current-network
:networks/networks networks
:multiaccount multiaccount)
:multiaccount (convert-multiaccounts-addresses
multiaccount))
:notifications/request-notifications-permissions nil}
;; NOTE: initializing mailserver depends on user mailserver
;; preference which is why we wait for config callback
Expand Down Expand Up @@ -318,4 +330,4 @@
(fx/merge cofx
{:db (assoc-in db [:multiaccounts/login :save-password?] true)}
(biometric/show-message bioauth-message bioauth-code)
(open-login-callback nil)))))
(open-login-callback nil)))))

0 comments on commit de786b6

Please sign in to comment.