Skip to content

Commit

Permalink
chore: rename messageId to messageHash
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos committed Feb 29, 2024
1 parent aab9b24 commit dec57e9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions library/events/json_message_event.nim
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ proc `%`*(value: WakuMessageHash): JsonNode =

type JsonMessageEvent* = ref object of JsonEvent
pubsubTopic*: string
messageId*: string
messageHash*: WakuMessageHash
wakuMessage*: JsonMessage

proc new*(T: type JsonMessageEvent,
Expand All @@ -83,12 +83,11 @@ proc new*(T: type JsonMessageEvent,
copyMem(addr proof[0], unsafeAddr msg.proof[0], len(msg.proof))

let msgHash = computeMessageHash(pubSubTopic, msg)
let msgHashHex = to0xHex(msgHash)

return JsonMessageEvent(
eventType: "message",
pubSubTopic: pubSubTopic,
messageId: msgHashHex,
messageHash: msgHash,
wakuMessage: JsonMessage(
payload: base64.encode(payload),
contentTopic: msg.contentTopic,
Expand Down

0 comments on commit dec57e9

Please sign in to comment.