mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-10 14:56:31 +00:00
fdcc9824a2
* feat(store): init allow messages to be marked as ephemeral * feat(store): replace ephemeral with ttl model * Revert "feat(store): replace ephemeral with ttl model" This reverts commit 4398c61c919dda8f014b4fcc0679c573c74854e4. * fix(store): flags and test * chore(store): remove storeTTL * chore(store): remove unused utils * fix: conflict * fix(store): make test more brief
21 lines
452 B
Nim
21 lines
452 B
Nim
{.push raises: [Defect].}
|
|
|
|
import
|
|
libp2p/protobuf/minprotobuf,
|
|
libp2p/varint
|
|
|
|
# Collection of utilities related to protobuffer encoding
|
|
|
|
proc write3*(proto: var ProtoBuffer, field: int, value: auto) =
|
|
if default(type(value)) != value:
|
|
proto.write(field, value)
|
|
|
|
proc finish3*(proto: var ProtoBuffer) =
|
|
if proto.buffer.len > 0:
|
|
proto.finish()
|
|
else:
|
|
proto.offset = 0
|
|
|
|
proc `==`*(a: zint64, b: zint64): bool =
|
|
int64(a) == int64(b)
|