File tree 2 files changed +11
-9
lines changed
2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 314
314
:id (int id)
315
315
:result result}}})
316
316
317
+ (defn normalize-message
318
+ " NOTE (andrey) there is no spec for this, so this implementation just to be compatible with MM"
319
+ [message]
320
+ (if (ethereum/hex-to-utf8 message)
321
+ message
322
+ (ethereum/utf8-to-hex message)))
323
+
317
324
(defn normalize-sign-message-params
318
325
" NOTE (andrey) we need this function, because params may be mixed up"
319
326
[params]
320
327
(let [[first-param second-param] params]
321
328
(when (and (string? first-param) (string? second-param))
322
329
(cond
323
330
(ethereum/address? first-param)
324
- [first-param second-param]
331
+ [first-param ( normalize-message second-param) ]
325
332
(ethereum/address? second-param)
326
- [second-param first-param]))))
333
+ [second-param ( normalize-message first-param) ]))))
327
334
328
335
(fx/defn send-to-bridge
329
336
[cofx message]
Original file line number Diff line number Diff line change 137
137
(when normalized-key
138
138
(subs (sha3 normalized-key) 26 ))))
139
139
140
- (def bytes32-length 66 ) ; length of '0x' + 64 hex values. (a 32bytes value has 64 nibbles)
141
-
142
140
(defn hex->text
143
- " Converts a hexstring to UTF8 text. If the data received is 32 bytes long,
144
- return the value unconverted"
141
+ " Converts a hexstring to UTF8 text."
145
142
[data]
146
- (if (= bytes32-length (count (normalized-hex data)))
147
- data ; Assume it's a bytes32
148
- (hex-to-utf8 data)))
143
+ (hex-to-utf8 data))
You can’t perform that action at this time.
0 commit comments