mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-13 18:25:45 +00:00
[#12668] Fix gas estimation after using Set max
This commit is contained in:
parent
d0b3b4e293
commit
943fc37543
@ -228,6 +228,7 @@
|
|||||||
(fx/defn update-estimated-gas-error
|
(fx/defn update-estimated-gas-error
|
||||||
{:events [:signing/update-estimated-gas-error]}
|
{:events [:signing/update-estimated-gas-error]}
|
||||||
[{db :db} {:keys [message]}]
|
[{db :db} {:keys [message]}]
|
||||||
|
(log/warn "signing/update-estimated-gas-error" message)
|
||||||
{:db (-> db
|
{:db (-> db
|
||||||
(assoc-in [:signing/edit-fee :gas-loading?] false)
|
(assoc-in [:signing/edit-fee :gas-loading?] false)
|
||||||
(assoc-in [:signing/tx :gas-error-message] message))})
|
(assoc-in [:signing/tx :gas-error-message] message))})
|
||||||
@ -366,7 +367,10 @@
|
|||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
:signing/update-estimated-gas
|
:signing/update-estimated-gas
|
||||||
(fn [{:keys [obj success-event error-event]}]
|
(fn [{:keys [obj success-event error-event]}]
|
||||||
|
(let [value (:value obj)]
|
||||||
(json-rpc/call {:method "eth_estimateGas"
|
(json-rpc/call {:method "eth_estimateGas"
|
||||||
:params [obj]
|
:params [(if value
|
||||||
|
(assoc obj :value "0x0")
|
||||||
|
obj)]
|
||||||
:on-success #(re-frame/dispatch [success-event %])
|
:on-success #(re-frame/dispatch [success-event %])
|
||||||
:on-error #(re-frame/dispatch [error-event %])})))
|
:on-error #(re-frame/dispatch [error-event %])}))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user