bug 4123 - fixed dapp transactions and incorrect amount formatting in transaction fee screen

Signed-off-by: Goran Jovic <goranjovic@gmail.com>
This commit is contained in:
Goran Jovic 2018-05-25 09:22:11 +02:00
parent 4b7360db17
commit 957c09a55e
No known key found for this signature in database
GPG Key ID: D429D1A9B2EB8A8E
2 changed files with 6 additions and 4 deletions

View File

@ -210,7 +210,7 @@
[react/view
[components/cartouche {:disabled? disabled?}
(i18n/label :t/amount)
[amount-input m]]
[amount-input m token]]
(when error
[tooltip/tooltip error])])

View File

@ -115,9 +115,11 @@
(defview transaction-fee []
(letsubs [{:keys [amount symbol] :as transaction} [:wallet.send/transaction]
network [:get-current-account-network]
edit [:wallet/edit]]
(let [gas (or (:gas edit) (:gas transaction))
gas-price (or (:gas-price edit) (:gas-price transaction))]
gas-price (or (:gas-price edit) (:gas-price transaction))
{:keys [decimals]} (tokens/asset-for (ethereum/network->chain-keyword network) symbol)]
[wallet.components/simple-screen {:status-toolbar-type :modal-wallet}
[toolbar true act/close-white
(i18n/label :t/wallet-transaction-fee)]
@ -151,7 +153,7 @@
(i18n/label :t/amount)
[react/view {:accessibility-label :amount-input}
[wallet.components/cartouche-text-content
(str (money/to-fixed (money/wei->ether amount)))
(str (money/to-fixed (money/internal->formatted amount symbol decimals)))
(name symbol)]]]
[wallet.components/cartouche {:disabled? true}
(i18n/label :t/wallet-transaction-total-fee)
@ -280,7 +282,7 @@
(i18n/label :t/message)
[components/amount-input {:disabled? true
:input-options {:multiline true
:default-value data}}]]]]
:default-value data}} nil]]]]
[signing-buttons
#(re-frame/dispatch [:wallet/discard-transaction-navigate-back])
#(re-frame/dispatch [:wallet/sign-transaction-modal])