Fix code breakage after the rebase

This commit is contained in:
Zahary Karadjov 2021-11-22 16:25:29 +02:00
parent 3599a73b58
commit 7ab1b31614
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
4 changed files with 9 additions and 6 deletions

View File

@ -28,4 +28,7 @@ proc buildBinary(name: string, srcDir = "./", params = "", cmdParams = "", lang
exec "nim " & lang & " --out:./build/" & name & " " & params & " " & srcDir & name & ".nim" & " " & cmdParams
task test, "run tests":
buildBinary "all", "tests/", "-r -f --hints:off --debuginfo --path:'.' --threads:on -d:chronicles_log_level=ERROR", getLang()
buildBinary "all", "tests/",
params = "-r -f --hints:off --debuginfo --path:'.' --threads:on -d:chronicles_log_level=ERROR",
cmdParams = "",
lang = getLang()

View File

@ -100,7 +100,7 @@ proc registerProxyMethod*(proxy: var RpcProxy, methodName: string) =
proc stop*(proxy: RpcProxy) {.async.} =
await proxy.getClient().close()
proxy.rpcHttpServer.stop()
await proxy.rpcHttpServer.stop()
proc closeWait*(proxy: RpcProxy) {.async.} =
await proxy.rpcHttpServer.closeWait()

View File

@ -134,7 +134,7 @@ proc new*(T: type RpcHttpServer): T =
T(router: RpcRouter.init(), httpServers: @[])
proc new*(T: type RpcHttpServer, router: RpcRouter): T =
T(router: router, servers: @[])
T(router: router, httpServers: @[])
proc newRpcHttpServer*(): RpcHttpServer =
RpcHttpServer.new()
@ -155,12 +155,12 @@ proc newRpcHttpServer*(addresses: openArray[string]): RpcHttpServer =
proc newRpcHttpServer*(addresses: openArray[string], router: RpcRouter): RpcHttpServer =
## Create new server and assign it to addresses ``addresses``.
result = newRpcHttpServer(router)
result.addStreamServers(addresses)
result.addHttpServers(addresses)
proc newRpcHttpServer*(addresses: openArray[TransportAddress], router: RpcRouter): RpcHttpServer =
## Create new server and assign it to addresses ``addresses``.
result = newRpcHttpServer(router)
result.addStreamServers(addresses)
result.addHttpServers(addresses)
proc start*(server: RpcHttpServer) =
## Start the RPC server.

View File

@ -40,7 +40,7 @@ suite "Proxy RPC through http":
expect(CatchableError):
discard waitFor client.call("missingMethod", %[%"abc"])
srv.stop()
waitFor srv.stop()
waitFor srv.closeWait()
waitFor proxy.stop()
waitFor proxy.closeWait()