From d280dcf5aae3aec95ae6f45e122bc8dd2aeb4253 Mon Sep 17 00:00:00 2001 From: coffeepots Date: Thu, 12 Apr 2018 19:29:48 +0100 Subject: [PATCH] Re-add serve --- tests/testserverclient.nim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/testserverclient.nim b/tests/testserverclient.nim index d356a27..ff14f60 100644 --- a/tests/testserverclient.nim +++ b/tests/testserverclient.nim @@ -9,9 +9,9 @@ proc myProc* {.rpc.} = var srv = newRpcServer("") # This is required to automatically register `myProc` to new servers registerRpcs(srv) +asyncCheck srv.serve # TODO: Avoid having to add procs twice, once for the ethprocs in newRpcServer, # and again with the extra `myProc` rpc - when isMainModule: # create on localhost, default port suite "RPC": @@ -26,8 +26,10 @@ when isMainModule: test "SHA3": response = waitFor client.web3_sha3(%"abc") check response.result.getStr == "3A985DA74FE225B2045C172D6BD390BD855F086E3E9D525B46BFE24511431532" - response = waitFor client.call("myProc", %"abc") - echo response.result.getStr + test "Custom RPC": + response = waitFor client.call("myProc", %"abc") + check response.result.getStr == "Hello" waitFor main() + \ No newline at end of file