mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-09 15:24:34 +00:00
[#11333] personal_sign method does not work in status
Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
parent
9e466976dc
commit
f1d070ed82
@ -314,6 +314,13 @@
|
|||||||
:id (int id)
|
:id (int id)
|
||||||
:result result}}})
|
:result result}}})
|
||||||
|
|
||||||
|
(defn normalize-message
|
||||||
|
"NOTE (andrey) there is no spec for this, so this implementation just to be compatible with MM"
|
||||||
|
[message]
|
||||||
|
(if (ethereum/hex-to-utf8 message)
|
||||||
|
message
|
||||||
|
(ethereum/utf8-to-hex message)))
|
||||||
|
|
||||||
(defn normalize-sign-message-params
|
(defn normalize-sign-message-params
|
||||||
"NOTE (andrey) we need this function, because params may be mixed up"
|
"NOTE (andrey) we need this function, because params may be mixed up"
|
||||||
[params]
|
[params]
|
||||||
@ -321,9 +328,9 @@
|
|||||||
(when (and (string? first-param) (string? second-param))
|
(when (and (string? first-param) (string? second-param))
|
||||||
(cond
|
(cond
|
||||||
(ethereum/address? first-param)
|
(ethereum/address? first-param)
|
||||||
[first-param second-param]
|
[first-param (normalize-message second-param)]
|
||||||
(ethereum/address? second-param)
|
(ethereum/address? second-param)
|
||||||
[second-param first-param]))))
|
[second-param (normalize-message first-param)]))))
|
||||||
|
|
||||||
(fx/defn send-to-bridge
|
(fx/defn send-to-bridge
|
||||||
[cofx message]
|
[cofx message]
|
||||||
|
@ -137,12 +137,7 @@
|
|||||||
(when normalized-key
|
(when normalized-key
|
||||||
(subs (sha3 normalized-key) 26))))
|
(subs (sha3 normalized-key) 26))))
|
||||||
|
|
||||||
(def bytes32-length 66) ; length of '0x' + 64 hex values. (a 32bytes value has 64 nibbles)
|
|
||||||
|
|
||||||
(defn hex->text
|
(defn hex->text
|
||||||
"Converts a hexstring to UTF8 text. If the data received is 32 bytes long,
|
"Converts a hexstring to UTF8 text."
|
||||||
return the value unconverted"
|
|
||||||
[data]
|
[data]
|
||||||
(if (= bytes32-length (count (normalized-hex data)))
|
(hex-to-utf8 data))
|
||||||
data ; Assume it's a bytes32
|
|
||||||
(hex-to-utf8 data)))
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user