Check for empty public key

We check that ENS does not return an empty public key. In addition to
that validation is done on status-go in order to avoid saving the chat.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2020-02-07 09:55:46 +01:00
parent 06025ce26f
commit 3d4ee8fe6a
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,6 @@
(ns status-im.ui.screens.add-new.new-chat.db
(:require [status-im.utils.hex :as hex]
[status-im.ethereum.ens :as ens]
[status-im.utils.platform :as platform]
[status-im.i18n :as i18n]
[cljs.spec.alpha :as spec]
@ -11,7 +12,8 @@
(defn validate-pub-key [db public-key]
(cond
(not (spec/valid? :global/public-key public-key))
(or (not (spec/valid? :global/public-key public-key))
(= public-key ens/default-key))
(i18n/label (if platform/desktop?
:t/use-valid-contact-code-desktop
:t/use-valid-contact-code))

View File

@ -2,7 +2,7 @@
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
"owner": "status-im",
"repo": "status-go",
"version": "v0.43.0",
"commit-sha1": "f2eebd1e499e1eb7ab84d634792ec7927b1e79b3",
"src-sha256": "1pcsigvwlv1k4hnzfw2f7c9shhavinyqg6711xnq3jkr4j53j2p8"
"version": "v0.43.1",
"commit-sha1": "0b6ad662b519ce0bc0f0c1c65f8c5eb77ddb2904",
"src-sha256": "1rn11ig98pb6y5gp5w9vzh41grsampd8bz09zdqz2rzfdic1b66i"
}