mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-07-23 21:13:14 +00:00
* move rln specific procs and types * Renaming and restructuring RLN module * Rename waku_rln_relay to waku_rln * rename rln-relay types to rln * Fix linting * update logScope topics to match new rln module name * Rename waku_rln module to rln * Rename WakuRln type to Rln, rename FFI raw type to RlnRaw to avoid collision * Apply nph formatting * Rename local rlnRelay to rln in mountRlnRelay
37 lines
880 B
Nim
37 lines
880 B
Nim
import testutils/unittests, results
|
|
|
|
import logos_delivery/waku/rln/rln/rln_interface
|
|
import logos_delivery/waku/rln/rln/wrappers
|
|
|
|
suite "Vec_uint8":
|
|
suite "toVecUint8":
|
|
test "valid":
|
|
# Given
|
|
let bytes: seq[byte] = @[0x01, 0x02, 0x03]
|
|
|
|
# When — wrap as a Vec_uint8 view then read the bytes back
|
|
var vec = toVecUint8(bytes)
|
|
let roundtrip = vecToSeq(vec)
|
|
|
|
# Then — byte values are preserved
|
|
check:
|
|
roundtrip == bytes
|
|
|
|
suite "RlnConfig":
|
|
suite "createRLNInstance":
|
|
test "ok":
|
|
# When we create the RLN instance (stateless build — no tree_depth arg)
|
|
let rlnRes = createRLNInstance()
|
|
|
|
# Then it succeeds
|
|
check:
|
|
rlnRes.isOk()
|
|
|
|
test "default":
|
|
# When we create the RLN instance
|
|
let rlnRes = createRLNInstance()
|
|
|
|
# Then it succeeds
|
|
check:
|
|
rlnRes.isOk()
|