mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-16 04:43:12 +00:00
chore: fix lint, add todos
This commit is contained in:
parent
c4cb4121ed
commit
49c8f549b3
@ -89,6 +89,10 @@ proc publish*(
|
||||
peerId = shortLog(peer.peerId),
|
||||
msg_hash = computeMessageHash(pubsubTopic.get(""), message).to0xHex
|
||||
|
||||
# TODO: i13n POC: add eligibilityProof to the request
|
||||
# (if expected by the server - how does the client know?..)
|
||||
# The tx must have already been sent at this point?
|
||||
|
||||
let pushRequest = LightpushRequest(
|
||||
requestId: generateRequestId(wl.rng), pubSubTopic: pubSubTopic, message: message
|
||||
)
|
||||
|
||||
@ -73,6 +73,9 @@ proc handleRequest*(
|
||||
statusDesc: some(msg),
|
||||
)
|
||||
|
||||
# TODO: i13n POC: check eligibility here (if eligibilityManager.isSome)
|
||||
# if eligibility check fails, return a response with LightpushStatusCode.PAYMENT_REQUIRED
|
||||
|
||||
waku_lightpush_v3_messages.inc(labelValues = ["PushRequest"])
|
||||
|
||||
notice "handling lightpush request",
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import std/options
|
||||
import ../waku_core
|
||||
import waku/incentivization/rpc
|
||||
import ../incentivization/rpc
|
||||
|
||||
type
|
||||
LightpushRequest* = object
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import std/options
|
||||
import ../common/protobuf, ../waku_core, ./rpc
|
||||
import waku/incentivization/[rpc, rpc_codec]
|
||||
import ../incentivization/[rpc, rpc_codec]
|
||||
|
||||
const DefaultMaxRpcSize* = -1
|
||||
|
||||
@ -13,7 +13,6 @@ proc encode*(rpc: LightpushRequest): ProtoBuffer =
|
||||
pb.write3(20, rpc.pubSubTopic)
|
||||
pb.write3(21, rpc.message.encode())
|
||||
|
||||
# Only encode eligibilityProof if it exists
|
||||
if rpc.eligibilityProof.isSome():
|
||||
pb.write3(22, rpc.eligibilityProof.get().encode())
|
||||
|
||||
@ -42,7 +41,6 @@ proc decode*(T: type LightpushRequest, buffer: seq[byte]): ProtobufResult[T] =
|
||||
else:
|
||||
rpc.message = ?WakuMessage.decode(messageBuf)
|
||||
|
||||
# Decode eligibilityProof only if the field is present
|
||||
var eligibilityProofBytes: seq[byte]
|
||||
if not ?pb.getField(22, eligibilityProofBytes):
|
||||
rpc.eligibilityProof = none(EligibilityProof)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user