[#12837] Cannot remove value from the 'Custom nonce' field

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
andrey 2021-11-23 14:05:11 +01:00
parent 8b055cd3c3
commit ae26024890
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
3 changed files with 5 additions and 9 deletions

View File

@ -7,7 +7,8 @@
[status-im.utils.money :as money]
[status-im.signing.eip1559 :as eip1559]
[taoensso.timbre :as log]
[status-im.popover.core :as popover]))
[status-im.popover.core :as popover]
[clojure.string :as string]))
(def min-gas-price-wei ^js (money/bignumber 1))
@ -211,9 +212,7 @@
[{db :db} price]
(if (eip1559/sync-enabled?)
(let [{:keys [normal-base-fee max-priority-fee]} price
max-priority-fee-bn (money/with-precision
(get-suggested-tip max-priority-fee)
0)]
max-priority-fee-bn (money/with-precision (get-suggested-tip max-priority-fee) 0)]
{:db (-> db
(assoc-in [:signing/tx :maxFeePerGas]
(money/to-hex (money/add max-priority-fee-bn
@ -279,7 +278,7 @@
{:events [:signing.nonce/submit]}
[{db :db :as cofx} nonce]
(fx/merge cofx
{:db (assoc-in db [:signing/tx :nonce] nonce)}
{:db (assoc-in db [:signing/tx :nonce] (if (string/blank? nonce) nil nonce))}
(bottom-sheet/hide-bottom-sheet)))
(re-frame/reg-fx

View File

@ -399,6 +399,5 @@
{:type :primary
:accessibility-label :save-nonce
:theme :accent
:disabled (clojure.string/blank? @nonce)
:on-press #(re-frame/dispatch [:signing.nonce/submit @nonce])}
(i18n/label :t/save)]]])))

View File

@ -439,9 +439,7 @@
(let [{:keys [slow-base-fee normal-base-fee fast-base-fee
current-base-fee max-priority-fee]}
price
max-priority-fee-bn (money/with-precision
(signing.gas/get-suggested-tip max-priority-fee)
0)
max-priority-fee-bn (money/with-precision (signing.gas/get-suggested-tip max-priority-fee) 0)
fee-cap (-> normal-base-fee
money/bignumber
(money/add max-priority-fee-bn)