[#13046] No value in 'Gas amount limit' field in NFT dapps by default

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
andrey 2022-01-26 11:53:11 +01:00
parent 136a6313cd
commit a6eee856cf
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
2 changed files with 9 additions and 8 deletions

View File

@ -387,10 +387,7 @@
(re-frame/reg-fx
:signing/update-estimated-gas
(fn [{:keys [obj success-event error-event]}]
(let [value (:value obj)]
(json-rpc/call {:method "eth_estimateGas"
:params [(if value
(assoc obj :value "0x0")
obj)]
:on-success #(re-frame/dispatch [success-event %])
:on-error #(re-frame/dispatch [error-event %])}))))
(json-rpc/call {:method "eth_estimateGas"
:params [obj]
:on-success #(re-frame/dispatch [success-event %])
:on-error #(re-frame/dispatch [error-event %])})))

View File

@ -472,7 +472,11 @@
(str (wallet.utils/format-amount (.minus amount fee) decimals)))
(str (wallet.utils/format-amount amount decimals)))]
(when amount-text
{:db (assoc-in db [:wallet/prepare-transaction :amount-text] amount-text)})))
{:db (cond-> db
:always
(assoc-in [:wallet/prepare-transaction :amount-text] amount-text)
(= :ETH symbol)
(assoc-in [:wallet/prepare-transaction :gas] gas))})))
(fx/defn set-and-validate-request-amount
{:events [:wallet.request/set-amount-text]}