[#12991] Error when trying to edit 'per-gas price limit' on 1inch.exchange

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
andrey 2022-01-11 16:32:02 +01:00
parent 525577ab17
commit eb7a6ce45a
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
2 changed files with 11 additions and 12 deletions

View File

@ -272,14 +272,13 @@
:success-event :signing/update-estimated-gas-success :success-event :signing/update-estimated-gas-success
:error-event :signing/update-estimated-gas-error}}) :error-event :signing/update-estimated-gas-error}})
(fn [cofx] (fn [cofx]
(when-not (or maxFeePerGas gasPrice)
{:db (assoc-in (:db cofx) [:signing/edit-fee :gas-price-loading?] true) {:db (assoc-in (:db cofx) [:signing/edit-fee :gas-price-loading?] true)
:signing/update-gas-price :signing/update-gas-price
{:success-callback #(re-frame/dispatch {:success-callback #(re-frame/dispatch
[:wallet.send/update-gas-price-success :signing/tx %]) [:wallet.send/update-gas-price-success :signing/tx % tx-obj])
:error-callback #(re-frame/dispatch [:signing/update-gas-price-error %]) :error-callback #(re-frame/dispatch [:signing/update-gas-price-error %])
:network-id (get-in (ethereum/current-network db) :network-id (get-in (ethereum/current-network db)
[:config :NetworkId])}})))))) [:config :NetworkId])}})))))
(fx/defn check-queue [{:keys [db] :as cofx}] (fx/defn check-queue [{:keys [db] :as cofx}]
(let [{:signing/keys [tx queue]} db] (let [{:signing/keys [tx queue]} db]

View File

@ -434,7 +434,7 @@
(fx/defn wallet-send-gas-price-success (fx/defn wallet-send-gas-price-success
{:events [:wallet.send/update-gas-price-success]} {:events [:wallet.send/update-gas-price-success]}
[{db :db} tx-entry price] [{db :db} tx-entry price {:keys [maxFeePerGas maxPriorityFeePerGas gasPrice]}]
(if (eip1559/sync-enabled?) (if (eip1559/sync-enabled?)
(let [{:keys [slow-base-fee normal-base-fee fast-base-fee (let [{:keys [slow-base-fee normal-base-fee fast-base-fee
current-base-fee max-priority-fee]} current-base-fee max-priority-fee]}
@ -447,8 +447,8 @@
tip-cap (money/to-hex max-priority-fee-bn)] tip-cap (money/to-hex max-priority-fee-bn)]
{:db (-> db {:db (-> db
(update tx-entry assoc (update tx-entry assoc
:maxFeePerGas fee-cap :maxFeePerGas (or maxFeePerGas fee-cap)
:maxPriorityFeePerGas tip-cap) :maxPriorityFeePerGas (or maxPriorityFeePerGas tip-cap))
(assoc :wallet/current-base-fee current-base-fee (assoc :wallet/current-base-fee current-base-fee
:wallet/normal-base-fee normal-base-fee :wallet/normal-base-fee normal-base-fee
:wallet/slow-base-fee slow-base-fee :wallet/slow-base-fee slow-base-fee
@ -456,7 +456,7 @@
:wallet/current-priority-fee max-priority-fee) :wallet/current-priority-fee max-priority-fee)
(assoc-in [:signing/edit-fee :gas-price-loading?] false))}) (assoc-in [:signing/edit-fee :gas-price-loading?] false))})
{:db (-> db {:db (-> db
(assoc-in [:wallet/prepare-transaction :gasPrice] price) (assoc-in [:wallet/prepare-transaction :gasPrice] (or gasPrice price))
(assoc-in [:signing/edit-fee :gas-price-loading?] false))})) (assoc-in [:signing/edit-fee :gas-price-loading?] false))}))
(fx/defn set-max-amount (fx/defn set-max-amount