Debug func for getting next id, `assert` instead of `if`

This commit is contained in:
coffeepots 2018-06-13 19:12:29 +01:00
parent 374c5c02f8
commit 4143c2cc41
1 changed files with 4 additions and 4 deletions

View File

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