[#8762] Dapp can't derive a wallet balance, "Not enough ETH for gas" at attempt to send transaction in any DApp

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
Andrey Shovkoplyas 2019-08-16 11:56:44 +02:00 committed by yenda
parent c2f646b8bd
commit 11ed6f481f
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
1 changed files with 3 additions and 4 deletions

View File

@ -13,7 +13,8 @@
[re-frame.core :as re-frame] [re-frame.core :as re-frame]
[status-im.constants :as constants] [status-im.constants :as constants]
[status-im.utils.utils :as utils] [status-im.utils.utils :as utils]
status-im.utils.handlers)) status-im.utils.handlers
[status-im.ethereum.eip55 :as eip55]))
(re-frame/reg-fx (re-frame/reg-fx
:signing/send-transaction-fx :signing/send-transaction-fx
@ -254,9 +255,7 @@
{:dispatch (conj on-error "transaction was cancelled by user")})))) {:dispatch (conj on-error "transaction was cancelled by user")}))))
(defn normalize-tx-obj [db tx] (defn normalize-tx-obj [db tx]
(if (get-in tx [:tx-obj :from]) (update-in tx [:tx-obj :from] #(eip55/address->checksum (or % (ethereum/default-address db)))))
tx
(assoc-in tx [:tx-obj :from] (ethereum/default-address db))))
(fx/defn sign [{:keys [db] :as cofx} tx] (fx/defn sign [{:keys [db] :as cofx} tx]
"Signing transaction or message, shows signing sheet "Signing transaction or message, shows signing sheet