Skip to content

Commit

Permalink
[#8121] Resolved ENS address is not checksummed
Browse files Browse the repository at this point in the history
  • Loading branch information
flexsurfer committed May 7, 2019
1 parent 7b0ebf7 commit 9fd9604
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/status_im/ui/screens/wallet/choose_recipient/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@
:ens-name recipient
:cb #(re-frame/dispatch [:wallet.send/set-recipient %])}}
(if (ethereum/address? recipient)
(if (eip55/valid-address-checksum? recipient)
{:db (assoc-in db [:wallet :send-transaction :to] recipient)
:dispatch [:navigate-back]}
{:ui/show-error (i18n/label :t/wallet-invalid-address-checksum {:data recipient})})
(let [checksum (eip55/address->checksum recipient)]
(if (eip55/valid-address-checksum? checksum)
{:db (assoc-in db [:wallet :send-transaction :to] checksum)
:dispatch [:navigate-back]}
{:ui/show-error (i18n/label :t/wallet-invalid-address-checksum {:data recipient})}))
{:ui/show-error (i18n/label :t/wallet-invalid-address {:data recipient})})))))

(handlers/register-handler-fx
Expand Down

0 comments on commit 9fd9604

Please sign in to comment.