fix: change message ID provider to match go-waku (#1556)

This commit is contained in:
Hanno Cornelius 2023-02-13 18:22:34 +02:00 committed by GitHub
parent 0a15ce48d8
commit dd5243a41c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -8,7 +8,7 @@ else:
{.push raises: [].}
import
std/[tables, sequtils, hashes],
std/[tables, sequtils],
stew/results,
chronos,
chronicles,
@ -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: