fixed error on invalid utf-8 from dapp
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
b7a92505bc
commit
de03fc2d6a
|
@ -20,7 +20,9 @@
|
||||||
(.toAscii dependencies/Web3.prototype s))
|
(.toAscii dependencies/Web3.prototype s))
|
||||||
|
|
||||||
(defn to-utf8 [s]
|
(defn to-utf8 [s]
|
||||||
(.toUtf8 dependencies/Web3.prototype (str s)))
|
(try
|
||||||
|
(.toUtf8 dependencies/Web3.prototype (str s))
|
||||||
|
(catch :default err nil)))
|
||||||
|
|
||||||
(defn sha3 [s]
|
(defn sha3 [s]
|
||||||
(.sha3 dependencies/Web3.prototype s))
|
(.sha3 dependencies/Web3.prototype s))
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
[status-im.utils.money :as money]
|
[status-im.utils.money :as money]
|
||||||
[status-im.utils.types :as types]
|
[status-im.utils.types :as types]
|
||||||
[status-im.utils.utils :as utils]
|
[status-im.utils.utils :as utils]
|
||||||
[status-im.constants :as constants]))
|
[status-im.constants :as constants]
|
||||||
|
[status-im.transport.utils :as transport.utils]))
|
||||||
|
|
||||||
;;;; FX
|
;;;; FX
|
||||||
|
|
||||||
|
@ -158,11 +159,13 @@
|
||||||
|
|
||||||
(= method constants/web3-personal-sign)
|
(= method constants/web3-personal-sign)
|
||||||
|
|
||||||
(let [{:keys [data]} args]
|
(let [{:keys [data]} args
|
||||||
{:db (-> db
|
data' (transport.utils/to-utf8 data)]
|
||||||
(assoc-in [:wallet :transactions-unsigned id] {:data data :id id})
|
(when data'
|
||||||
(assoc-in [:wallet :send-transaction] {:id id :method method}))
|
{:db (-> db
|
||||||
:dispatch [:navigate-to-modal :wallet-sign-message-modal]}))))
|
(assoc-in [:wallet :transactions-unsigned id] {:data data' :id id})
|
||||||
|
(assoc-in [:wallet :send-transaction] {:id id :method method}))
|
||||||
|
:dispatch [:navigate-to-modal :wallet-sign-message-modal]})))))
|
||||||
|
|
||||||
(defn this-transaction-signing? [id signing-id view-id modal]
|
(defn this-transaction-signing? [id signing-id view-id modal]
|
||||||
(and (= signing-id id)
|
(and (= signing-id id)
|
||||||
|
|
|
@ -273,7 +273,7 @@
|
||||||
(i18n/label :t/message)
|
(i18n/label :t/message)
|
||||||
[components/amount-input {:disabled? true
|
[components/amount-input {:disabled? true
|
||||||
:input-options {:multiline true
|
:input-options {:multiline true
|
||||||
:default-value (transport.utils/to-utf8 data)}}]]]]
|
:default-value data}}]]]]
|
||||||
[signing-buttons
|
[signing-buttons
|
||||||
#(re-frame/dispatch [:wallet/discard-transaction-navigate-back])
|
#(re-frame/dispatch [:wallet/discard-transaction-navigate-back])
|
||||||
#(re-frame/dispatch [:wallet/sign-transaction-modal])
|
#(re-frame/dispatch [:wallet/sign-transaction-modal])
|
||||||
|
|
Loading…
Reference in New Issue