# json-rpc # Copyright (c) 2019-2023 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) # * MIT license ([LICENSE-MIT](LICENSE-MIT)) # at your option. # This file may not be copied, modified, or distributed except according to # those terms. import unittest2, chronos/unittest2/asynctests, ../json_rpc/[rpcserver, rpcclient, jsonmarshal] const TestsCount = 100 const bigChunkSize = 4 * 8192 suite "JSON-RPC/http": setup: var httpsrv = newRpcHttpServer(["127.0.0.1:0"]) # Create RPC on server httpsrv.rpc("myProc") do(input: string, data: array[0..3, int]): result = %("Hello " & input & " data: " & $data) httpsrv.rpc("noParamsProc") do(): result = %("Hello world") httpsrv.rpc("bigchunkMethod") do() -> seq[byte]: result = newSeq[byte](bigChunkSize) for i in 0..