Skip to content

Commit

Permalink
fix: change message ID provider to match go-waku (#1556)
Browse files Browse the repository at this point in the history
  • Loading branch information
jm-clius authored Feb 13, 2023
1 parent 0a15ce4 commit dd5243a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions waku/v2/protocol/waku_relay.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else:
{.push raises: [].}

import
std/[tables, sequtils, hashes],
std/[tables, sequtils],
stew/results,
chronos,
chronicles,
Expand Down Expand Up @@ -80,11 +80,8 @@ method initPubSub(w: WakuRelay) {.raises: [InitializationError].} =
proc new*(T: type WakuRelay, switch: Switch, triggerSelf: bool = true): WakuRelayResult[T] =

proc msgIdProvider(msg: messages.Message): Result[MessageID, ValidationResult] =
let hash = MultiHash.digest("sha2-256", msg.data)
if hash.isErr():
ok(toBytes($hashes.hash(msg.data)))
else:
ok(hash.value.data.buffer)
let hash = sha256.digest(msg.data)
ok(toSeq(hash.data))

var wr: WakuRelay
try:
Expand Down

0 comments on commit dd5243a

Please sign in to comment.