fix: fix filter v2 proto fields (#1716)

This commit is contained in:
Hanno Cornelius 2023-05-05 10:29:53 +02:00 committed by GitHub
parent 3e0a693d2e
commit 68a39c65bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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
@ -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)