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:
parent
06025ce26f
commit
3d4ee8fe6a
|
@ -1,5 +1,6 @@
|
||||||
(ns status-im.ui.screens.add-new.new-chat.db
|
(ns status-im.ui.screens.add-new.new-chat.db
|
||||||
(:require [status-im.utils.hex :as hex]
|
(:require [status-im.utils.hex :as hex]
|
||||||
|
[status-im.ethereum.ens :as ens]
|
||||||
[status-im.utils.platform :as platform]
|
[status-im.utils.platform :as platform]
|
||||||
[status-im.i18n :as i18n]
|
[status-im.i18n :as i18n]
|
||||||
[cljs.spec.alpha :as spec]
|
[cljs.spec.alpha :as spec]
|
||||||
|
@ -11,7 +12,8 @@
|
||||||
|
|
||||||
(defn validate-pub-key [db public-key]
|
(defn validate-pub-key [db public-key]
|
||||||
(cond
|
(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?
|
(i18n/label (if platform/desktop?
|
||||||
:t/use-valid-contact-code-desktop
|
:t/use-valid-contact-code-desktop
|
||||||
:t/use-valid-contact-code))
|
:t/use-valid-contact-code))
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
|
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
|
||||||
"owner": "status-im",
|
"owner": "status-im",
|
||||||
"repo": "status-go",
|
"repo": "status-go",
|
||||||
"version": "v0.43.0",
|
"version": "v0.43.1",
|
||||||
"commit-sha1": "f2eebd1e499e1eb7ab84d634792ec7927b1e79b3",
|
"commit-sha1": "0b6ad662b519ce0bc0f0c1c65f8c5eb77ddb2904",
|
||||||
"src-sha256": "1pcsigvwlv1k4hnzfw2f7c9shhavinyqg6711xnq3jkr4j53j2p8"
|
"src-sha256": "1rn11ig98pb6y5gp5w9vzh41grsampd8bz09zdqz2rzfdic1b66i"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue