nwaku/tests/waku_rln_relay/rln/buffer_utils.nim
Álex Cabeza Romero f86baa01a7
test(rln): Implement some rln unit tests (#2356)
* Fix sanity check location.
* Implement some rln tests.
2024-02-02 09:56:41 +01:00

12 lines
293 B
Nim

import ../../../../waku/waku_rln_relay/rln/rln_interface
proc `==`*(a: Buffer, b: seq[uint8]): bool =
if a.len != uint(b.len):
return false
let bufferArray = cast[ptr UncheckedArray[uint8]](a.ptr)
for i in 0..<b.len:
if bufferArray[i] != b[i]:
return false
return true