mirror of https://github.com/waku-org/nwaku.git
fix(store): set store rpc codec pagesize type to uint64
This commit is contained in:
parent
67939bb8ac
commit
77c64043f9
|
@ -72,7 +72,7 @@ proc encode*(rpc: PagingInfoRPC): ProtoBuffer =
|
|||
## returns the resultant ProtoBuffer
|
||||
var pb = initProtoBuffer()
|
||||
|
||||
pb.write3(1, rpc.pageSize.map(proc(size: uint64): zint64 = zint64(size)))
|
||||
pb.write3(1, rpc.pageSize)
|
||||
pb.write3(2, rpc.cursor.map(encode))
|
||||
pb.write3(3, rpc.direction.map(proc(d: PagingDirectionRPC): uint32 = uint32(ord(d))))
|
||||
pb.finish3()
|
||||
|
@ -84,11 +84,11 @@ proc decode*(T: type PagingInfoRPC, buffer: seq[byte]): ProtoResult[T] =
|
|||
var rpc = PagingInfoRPC()
|
||||
let pb = initProtoBuffer(buffer)
|
||||
|
||||
var pageSize: zint64
|
||||
var pageSize: uint64
|
||||
if not ?pb.getField(1, pageSize):
|
||||
rpc.pageSize = none(uint64)
|
||||
else:
|
||||
rpc.pageSize = some(uint64(pageSize))
|
||||
rpc.pageSize = some(pageSize)
|
||||
|
||||
var cursorBuffer: seq[byte]
|
||||
if not ?pb.getField(2, cursorBuffer):
|
||||
|
|
Loading…
Reference in New Issue