Skip to content

Commit

Permalink
Fix ens name hash exception for bad names
Browse files Browse the repository at this point in the history
Fixes #11022

Signed-off-by: Gheorghe Pinzaru <feross95@gmail.com>
  • Loading branch information
Ferossgp committed Aug 6, 2020
1 parent 9599753 commit 72726e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/status_im/ethereum/ens.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
(let [[label remainder] (-> s
string/lower-case
(string/split #"\." 2))]
(ethereum/sha3 (str (namehash remainder)
(subs (ethereum/sha3 label) 2)))))))
(if-not (seq label)
default-namehash
(ethereum/sha3 (str (namehash remainder)
(subs (ethereum/sha3 label) 2))))))))

;; Registry contract

Expand Down

0 comments on commit 72726e2

Please sign in to comment.