bug #4593 - fixed gas update after default gas

This commit is contained in:
Goran Jovic 2018-06-04 12:29:00 +02:00 committed by Roman Volosovskyi
parent cd5542f648
commit 435b2271fd
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
2 changed files with 6 additions and 2 deletions

View File

@ -241,7 +241,9 @@
(handlers/register-handler-db
:wallet/update-gas-price-success
(fn [db [_ price edit?]]
(assoc-in db [:wallet (if edit? :edit :send-transaction) :gas-price] price)))
(if edit?
(assoc-in db [:wallet :edit :gas-price] {:value price :invalid? false})
(assoc-in db [:wallet :send-transaction :gas-price] price))))
(handlers/register-handler-fx
:wallet/update-estimated-gas

View File

@ -353,7 +353,9 @@
:wallet.send/reset-gas-default
(fn [{:keys [db]}]
{:dispatch [:wallet/update-gas-price true]
:db (assoc-in db [:wallet :edit :gas] nil)}))
:db (assoc-in db [:wallet :edit :gas]
{:value (ethereum/estimate-gas (-> db :wallet :send-transaction :symbol))
:invalid? false})}))
(defn update-gas-price [db edit?]
{:update-gas-price {:web3 (:web3 db)