mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-07 00:13:06 +00:00
deploy: 618d48d422e19070a9b55a540727767732cfe806
This commit is contained in:
parent
1873ed97c6
commit
6be64d946f
@ -1 +1 @@
|
||||
1617404008
|
||||
1617818926
|
||||
@ -16,11 +16,13 @@ type
|
||||
payload*: seq[byte]
|
||||
contentTopic*: ContentTopic
|
||||
version*: uint32
|
||||
# the proof field indicates that the message is not a spam
|
||||
# this field will be used in the rln-relay protocol
|
||||
proof*: seq[byte]
|
||||
# sender generated timestamp
|
||||
timestamp*: float64
|
||||
# the proof field indicates that the message is not a spam
|
||||
# this field will be used in the rln-relay protocol
|
||||
# XXX Experimental, this is part of https://rfc.vac.dev/spec/17/ spec and not yet part of WakuMessage spec
|
||||
proof*: seq[byte]
|
||||
|
||||
|
||||
# Encoding and decoding -------------------------------------------------------
|
||||
proc init*(T: type WakuMessage, buffer: seq[byte]): ProtoResult[T] =
|
||||
@ -30,8 +32,9 @@ proc init*(T: type WakuMessage, buffer: seq[byte]): ProtoResult[T] =
|
||||
discard ? pb.getField(1, msg.payload)
|
||||
discard ? pb.getField(2, msg.contentTopic)
|
||||
discard ? pb.getField(3, msg.version)
|
||||
discard ? pb.getField(4, msg.proof)
|
||||
discard ? pb.getField(5, msg.timestamp)
|
||||
discard ? pb.getField(4, msg.timestamp)
|
||||
# XXX Experimental, this is part of https://rfc.vac.dev/spec/17/ spec and not yet part of WakuMessage spec
|
||||
discard ? pb.getField(21, msg.proof)
|
||||
|
||||
ok(msg)
|
||||
|
||||
@ -41,5 +44,5 @@ proc encode*(message: WakuMessage): ProtoBuffer =
|
||||
result.write(1, message.payload)
|
||||
result.write(2, message.contentTopic)
|
||||
result.write(3, message.version)
|
||||
result.write(4, message.proof)
|
||||
result.write(5, message.timestamp)
|
||||
result.write(4, message.timestamp)
|
||||
result.write(21, message.proof)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user