Should compile if chronicles log turned on

This commit is contained in:
jangko 2024-01-31 16:46:44 +07:00
parent 95a6f550cd
commit 2157e8980d
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9

View File

@ -89,10 +89,6 @@ proc callImpl(client: RpcHttpClient, reqBody: string): Future[string] {.async.}
var req: HttpClientRequestRef
var res: HttpClientResponseRef
debug "Sending message to RPC server",
address = client.httpAddress, msg_len = len(reqBody), name
trace "Message", msg = reqBody
req = HttpClientRequestRef.post(client.httpSession,
client.httpAddress.get,
body = reqBody.toOpenArrayByte(0, reqBody.len - 1),
@ -144,10 +140,16 @@ proc newRpcHttpClient*(
method call*(client: RpcHttpClient, name: string,
params: RequestParamsTx): Future[JsonString]
{.async, gcsafe.} =
let
id = client.getNextId()
reqBody = requestTxEncode(name, params, id)
resText = await client.callImpl(reqBody)
debug "Sending message to RPC server",
address = client.httpAddress, msg_len = len(reqBody), name
trace "Message", msg = reqBody
let resText = await client.callImpl(reqBody)
# completed by processMessage - the flow is quite weird here to accomodate
# socket and ws clients, but could use a more thorough refactoring