From 68dc4351d179a3d7c2a4d8e4527cf869707c3ca4 Mon Sep 17 00:00:00 2001 From: coffeepots Date: Wed, 9 May 2018 14:58:58 +0100 Subject: [PATCH] Fix `undeclared identifier: result` in `myProc` custom rpc --- tests/testserverclient.nim | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/testserverclient.nim b/tests/testserverclient.nim index 1a8da47..e23ccb4 100644 --- a/tests/testserverclient.nim +++ b/tests/testserverclient.nim @@ -1,7 +1,14 @@ -import ../ rpcclient, ../ rpcserver, - asyncdispatch, json, unittest, tables +import ../ rpcserver, ../ rpcclient, unittest, asyncdispatch, json, tables +#[ + TODO: Importing client before server causes the error: + Error: undeclared identifier: 'result' for the custom procedure. + This is because the rpc procs created by clientdispatch clash with ethprocs. + Currently, easiest solution is to import rpcserver (and therefore generate + ethprocs) before rpcclient. +]# # TODO: dummy implementations of RPC calls handled in async fashion. +# TODO: check required json parameters like version are being raised var srv = sharedRpcServer() srv.address = "localhost" srv.port = Port(8545) @@ -16,7 +23,6 @@ suite "RPC": var client = newRpcClient() await client.connect("localhost", Port(8545)) var response: Response - test "Version": response = waitFor client.web3_clientVersion(newJNull()) check response.result == %"Nimbus-RPC-Test" @@ -28,7 +34,5 @@ suite "RPC": response = waitFor client.call("myProc", %[%"abc", %[1, 2, 3, 4]]) check response.result.getStr == "Hello abc data: [1, 2, 3, 4]" - - waitFor main() \ No newline at end of file