Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should compile if chronicles log turned on #205

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions json_rpc/clients/httpclient.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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
Expand Down