mirror of
https://github.com/status-im/nim-json-rpc.git
synced 2025-02-24 02:08:28 +00:00
Fix code breakage after the rebase
This commit is contained in:
parent
3599a73b58
commit
7ab1b31614
@ -28,4 +28,7 @@ proc buildBinary(name: string, srcDir = "./", params = "", cmdParams = "", lang
|
|||||||
exec "nim " & lang & " --out:./build/" & name & " " & params & " " & srcDir & name & ".nim" & " " & cmdParams
|
exec "nim " & lang & " --out:./build/" & name & " " & params & " " & srcDir & name & ".nim" & " " & cmdParams
|
||||||
|
|
||||||
task test, "run tests":
|
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()
|
||||||
|
@ -100,7 +100,7 @@ proc registerProxyMethod*(proxy: var RpcProxy, methodName: string) =
|
|||||||
|
|
||||||
proc stop*(proxy: RpcProxy) {.async.} =
|
proc stop*(proxy: RpcProxy) {.async.} =
|
||||||
await proxy.getClient().close()
|
await proxy.getClient().close()
|
||||||
proxy.rpcHttpServer.stop()
|
await proxy.rpcHttpServer.stop()
|
||||||
|
|
||||||
proc closeWait*(proxy: RpcProxy) {.async.} =
|
proc closeWait*(proxy: RpcProxy) {.async.} =
|
||||||
await proxy.rpcHttpServer.closeWait()
|
await proxy.rpcHttpServer.closeWait()
|
||||||
|
@ -134,7 +134,7 @@ proc new*(T: type RpcHttpServer): T =
|
|||||||
T(router: RpcRouter.init(), httpServers: @[])
|
T(router: RpcRouter.init(), httpServers: @[])
|
||||||
|
|
||||||
proc new*(T: type RpcHttpServer, router: RpcRouter): T =
|
proc new*(T: type RpcHttpServer, router: RpcRouter): T =
|
||||||
T(router: router, servers: @[])
|
T(router: router, httpServers: @[])
|
||||||
|
|
||||||
proc newRpcHttpServer*(): RpcHttpServer =
|
proc newRpcHttpServer*(): RpcHttpServer =
|
||||||
RpcHttpServer.new()
|
RpcHttpServer.new()
|
||||||
@ -155,12 +155,12 @@ proc newRpcHttpServer*(addresses: openArray[string]): RpcHttpServer =
|
|||||||
proc newRpcHttpServer*(addresses: openArray[string], router: RpcRouter): RpcHttpServer =
|
proc newRpcHttpServer*(addresses: openArray[string], router: RpcRouter): RpcHttpServer =
|
||||||
## Create new server and assign it to addresses ``addresses``.
|
## Create new server and assign it to addresses ``addresses``.
|
||||||
result = newRpcHttpServer(router)
|
result = newRpcHttpServer(router)
|
||||||
result.addStreamServers(addresses)
|
result.addHttpServers(addresses)
|
||||||
|
|
||||||
proc newRpcHttpServer*(addresses: openArray[TransportAddress], router: RpcRouter): RpcHttpServer =
|
proc newRpcHttpServer*(addresses: openArray[TransportAddress], router: RpcRouter): RpcHttpServer =
|
||||||
## Create new server and assign it to addresses ``addresses``.
|
## Create new server and assign it to addresses ``addresses``.
|
||||||
result = newRpcHttpServer(router)
|
result = newRpcHttpServer(router)
|
||||||
result.addStreamServers(addresses)
|
result.addHttpServers(addresses)
|
||||||
|
|
||||||
proc start*(server: RpcHttpServer) =
|
proc start*(server: RpcHttpServer) =
|
||||||
## Start the RPC server.
|
## Start the RPC server.
|
||||||
|
@ -40,7 +40,7 @@ suite "Proxy RPC through http":
|
|||||||
expect(CatchableError):
|
expect(CatchableError):
|
||||||
discard waitFor client.call("missingMethod", %[%"abc"])
|
discard waitFor client.call("missingMethod", %[%"abc"])
|
||||||
|
|
||||||
srv.stop()
|
waitFor srv.stop()
|
||||||
waitFor srv.closeWait()
|
waitFor srv.closeWait()
|
||||||
waitFor proxy.stop()
|
waitFor proxy.stop()
|
||||||
waitFor proxy.closeWait()
|
waitFor proxy.closeWait()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user