Skip to content

Commit

Permalink
fix: fix filter v2 proto fields (#1716)
Browse files Browse the repository at this point in the history
  • Loading branch information
jm-clius committed May 5, 2023
1 parent 3e0a693 commit 68a39c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions waku/v2/waku_filter_v2/rpc_codec.nim
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ proc encode*(rpc: FilterSubscribeResponse): ProtoBuffer =
var pb = initProtoBuffer()

pb.write3(1, rpc.requestId)
pb.write3(2, rpc.statusCode)
pb.write3(3, rpc.statusDesc)
pb.write3(10, rpc.statusCode)
pb.write3(11, rpc.statusDesc)

pb

Expand All @@ -67,11 +67,11 @@ proc decode*(T: type FilterSubscribeResponse, buffer: seq[byte]): ProtobufResult
if not ?pb.getField(1, rpc.requestId):
return err(ProtobufError.missingRequiredField("request_id"))

if not ?pb.getField(2, rpc.statusCode):
if not ?pb.getField(10, rpc.statusCode):
return err(ProtobufError.missingRequiredField("status_code"))

var statusDesc: string
if not ?pb.getField(3, statusDesc):
if not ?pb.getField(11, statusDesc):
rpc.statusDesc = none(string)
else:
rpc.statusDesc = some(statusDesc)
Expand Down

0 comments on commit 68a39c6

Please sign in to comment.