Skip to content

Commit

Permalink
fix: code review
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos committed Aug 13, 2024
1 parent 9ab55c0 commit 655c60b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion waku/waku_core/message/digest.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ import ../topics, ./message

type WakuMessageHash* = array[32, byte]

func shortLog*(hash: WakuMessageHash): string =
## Returns compact string representation of ``WakuMessageHash``.
var hexhash = newStringOfCap(13)
hexhash &= hash.toOpenArray(0, 1).to0xHex()
hexhash &= "..."
hexhash &= hash.toOpenArray(hash.len - 2, hash.high).toHex()
hexhash

func `$`*(hash: WakuMessageHash): string =
return hash.to0xHex()
shortLog(hash)

const EmptyWakuMessageHash*: WakuMessageHash = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Expand Down

0 comments on commit 655c60b

Please sign in to comment.