mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-15 17:35:45 +00:00
chore: changing digest and hash log format from bytes to hex (#2363)
This commit is contained in:
parent
42204115c7
commit
025c6ec92a
@ -5,7 +5,7 @@ else:
|
|||||||
|
|
||||||
import
|
import
|
||||||
std/[tables, times, sequtils, options, algorithm, strutils],
|
std/[tables, times, sequtils, options, algorithm, strutils],
|
||||||
stew/results,
|
stew/[results, byteutils],
|
||||||
chronicles,
|
chronicles,
|
||||||
chronos,
|
chronos,
|
||||||
regex,
|
regex,
|
||||||
@ -108,10 +108,12 @@ proc handleMessage*(w: WakuArchive,
|
|||||||
let
|
let
|
||||||
msgDigest = computeDigest(msg)
|
msgDigest = computeDigest(msg)
|
||||||
msgHash = computeMessageHash(pubsubTopic, msg)
|
msgHash = computeMessageHash(pubsubTopic, msg)
|
||||||
|
msgDigestHex = toHex(msgDigest.data)
|
||||||
|
msgHashHex = toHex(msgHash)
|
||||||
msgReceivedTime = if msg.timestamp > 0: msg.timestamp
|
msgReceivedTime = if msg.timestamp > 0: msg.timestamp
|
||||||
else: getNanosecondTime(getTime().toUnixFloat())
|
else: getNanosecondTime(getTime().toUnixFloat())
|
||||||
|
|
||||||
trace "handling message", pubsubTopic=pubsubTopic, contentTopic=msg.contentTopic, timestamp=msg.timestamp, digest=msgDigest, messageHash=msgHash
|
trace "handling message", pubsubTopic=pubsubTopic, contentTopic=msg.contentTopic, timestamp=msg.timestamp, digest=msgDigestHex, messageHash=msgHashHex
|
||||||
|
|
||||||
let putRes = await w.driver.put(pubsubTopic, msg, msgDigest, msgHash, msgReceivedTime)
|
let putRes = await w.driver.put(pubsubTopic, msg, msgDigest, msgHash, msgReceivedTime)
|
||||||
if putRes.isErr():
|
if putRes.isErr():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user