Convert address to checksum address before testing for eip55
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
parent
1c972a4ad5
commit
25118052df
|
@ -82,7 +82,9 @@
|
||||||
:ens-name recipient
|
:ens-name recipient
|
||||||
:cb #(re-frame/dispatch [:wallet.send/set-recipient %])}}
|
:cb #(re-frame/dispatch [:wallet.send/set-recipient %])}}
|
||||||
(if (ethereum/address? recipient)
|
(if (ethereum/address? recipient)
|
||||||
(if (eip55/valid-address-checksum? recipient)
|
(if (-> recipient
|
||||||
|
ethereum/address->checksum
|
||||||
|
eip55/valid-address-checksum?)
|
||||||
{:db (assoc-in db [:wallet :send-transaction :to] recipient)
|
{:db (assoc-in db [:wallet :send-transaction :to] recipient)
|
||||||
:dispatch [:navigate-back]}
|
:dispatch [:navigate-back]}
|
||||||
{:ui/show-error (i18n/label :t/wallet-invalid-address-checksum {:data recipient})})
|
{:ui/show-error (i18n/label :t/wallet-invalid-address-checksum {:data recipient})})
|
||||||
|
|
|
@ -48,6 +48,10 @@
|
||||||
(when s
|
(when s
|
||||||
(.isAddress dependencies/Web3.prototype s)))
|
(.isAddress dependencies/Web3.prototype s)))
|
||||||
|
|
||||||
|
(defn address->checksum [s]
|
||||||
|
(when s
|
||||||
|
(.toChecksumAddress dependencies/Web3.prototype s)))
|
||||||
|
|
||||||
(defn network->chain-id [network]
|
(defn network->chain-id [network]
|
||||||
(get-in network [:config :NetworkId]))
|
(get-in network [:config :NetworkId]))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue