mirror of
https://github.com/codex-storage/nim-json-rpc.git
synced 2025-02-23 08:28:23 +00:00
Debug func for getting next id, assert
instead of if
This commit is contained in:
parent
374c5c02f8
commit
4143c2cc41
@ -1,5 +1,6 @@
|
||||
include ../ eth-rpc / client
|
||||
import chronicles
|
||||
|
||||
proc nextId*(self: RpcClient): int64 = self.nextId
|
||||
|
||||
proc rawCall*(self: RpcClient, name: string,
|
||||
msg: string): Future[Response] {.async.} =
|
||||
@ -7,10 +8,9 @@ proc rawCall*(self: RpcClient, name: string,
|
||||
let id = $self.nextId
|
||||
self.nextId.inc
|
||||
|
||||
var s = msg & "\c\l"
|
||||
var s = msg & "\c\l"
|
||||
let res = await self.transp.write(s)
|
||||
|
||||
debug "Receiving length assert", value = res, length = len(msg), lengthDifferent = res != len(msg)
|
||||
assert res == len(s)
|
||||
|
||||
# completed by processMessage.
|
||||
var newFut = newFuture[Response]()
|
||||
|
Loading…
x
Reference in New Issue
Block a user