mirror of
https://github.com/logos-storage/nim-json-rpc.git
synced 2026-01-09 09:03:10 +00:00
fix the package structure to make Nimble happy
This commit is contained in:
parent
d7b95877fc
commit
642fdd591f
@ -40,7 +40,7 @@ When an error occurs, the `error` is populated, otherwise `result` will be popul
|
||||
Here's a simple example:
|
||||
|
||||
```nim
|
||||
import rpcserver
|
||||
import json_rpc/rpcserver
|
||||
|
||||
var router = newRpcRouter()
|
||||
|
||||
@ -272,7 +272,7 @@ This example uses the socket transport defined in `socket.nim`.
|
||||
Once executed, the "hello" RPC will be available to a socket based client.
|
||||
|
||||
```nim
|
||||
import rpcserver
|
||||
import json_rpc/rpcserver
|
||||
|
||||
# Create a socket server for transport
|
||||
var srv = newRpcSocketServer("localhost", Port(8585))
|
||||
@ -298,7 +298,7 @@ The `call` procedure takes care of the basic format of the JSON to send to the s
|
||||
However you still need to provide `params` as a `JsonNode`, which must exactly match the parameters defined in the equivalent `rpc` definition.
|
||||
|
||||
```nim
|
||||
import rpcclient, rpcserver, asyncdispatch, json
|
||||
import json_rpc/[rpcclient, rpcserver], asyncdispatch, json
|
||||
|
||||
var
|
||||
server = newRpcSocketServer("localhost", Port(8545))
|
||||
@ -404,4 +404,4 @@ Please make sure to update tests as appropriate.
|
||||
# License
|
||||
[MIT](https://choosealicense.com/licenses/mit/)
|
||||
or
|
||||
Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
|
||||
Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import
|
||||
json, tables, asyncdispatch2, jsonmarshal, strutils, macros,
|
||||
json, tables, asyncdispatch2, jsonmarshal, strutils, macros,
|
||||
chronicles, options
|
||||
export asyncdispatch2, json, jsonmarshal
|
||||
|
||||
|
||||
3
json_rpc/rpcclient.nim
Normal file
3
json_rpc/rpcclient.nim
Normal file
@ -0,0 +1,3 @@
|
||||
import client
|
||||
import clients/[socketclient, httpclient]
|
||||
export client, socketclient, httpclient
|
||||
3
json_rpc/rpcserver.nim
Normal file
3
json_rpc/rpcserver.nim
Normal file
@ -0,0 +1,3 @@
|
||||
import server
|
||||
import servers/[socketserver, httpserver]
|
||||
export server, socketserver, httpserver
|
||||
@ -1,3 +0,0 @@
|
||||
import json_rpc/client
|
||||
import json_rpc/clients/[socketclient, httpclient]
|
||||
export client, socketclient, httpclient
|
||||
@ -1,3 +0,0 @@
|
||||
import json_rpc/server
|
||||
import json_rpc/servers/[socketserver, httpserver]
|
||||
export server, socketserver, httpserver
|
||||
@ -58,8 +58,8 @@ template hexQuantityStr*(value: string): HexQuantityStr = value.HexQuantityStr
|
||||
|
||||
# Converters
|
||||
|
||||
import json
|
||||
from ../rpcserver import expect
|
||||
import json
|
||||
from ../json_rpc/rpcserver import expect
|
||||
|
||||
proc `%`*(value: HexDataStr): JsonNode =
|
||||
if not value.validate:
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
import ../rpcserver, nimcrypto, json, stint, strutils, ethtypes, stintjson, ethhexstrings
|
||||
import
|
||||
strutils, json,
|
||||
nimcrypto, stint,
|
||||
ethtypes, ethhexstrings, stintjson, ../json_rpc/rpcserver
|
||||
|
||||
#[
|
||||
For details on available RPC calls, see: https://github.com/ethereum/wiki/wiki/JSON-RPC
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import json, stint
|
||||
from ../rpcserver import expect
|
||||
from ../json_rpc/rpcserver import expect
|
||||
|
||||
template stintStr(n: UInt256|Int256): JsonNode =
|
||||
var s = n.toHex
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
allow unchecked and unformatted calls.
|
||||
]#
|
||||
|
||||
import unittest, debugclient, ../rpcserver
|
||||
import unittest, debugclient, ../json_rpc/rpcserver
|
||||
import strformat, chronicles
|
||||
|
||||
var server = newRpcSocketServer("localhost", 8547.Port)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import unittest, json, tables
|
||||
import ../rpcclient, ../rpcserver
|
||||
import ../json_rpc/[rpcclient, rpcserver]
|
||||
import stint, ethtypes, ethprocs, stintjson, nimcrypto, ethhexstrings, chronicles
|
||||
|
||||
from os import getCurrentDir, DirSep
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import unittest, json, strutils
|
||||
import httputils, chronicles
|
||||
import ../rpcserver, ../rpcclient
|
||||
import ../json_rpc/[rpcserver, rpcclient]
|
||||
|
||||
const
|
||||
TestsCount = 100
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import unittest, json, tables, chronicles
|
||||
import ../rpcserver
|
||||
import ../json_rpc/rpcserver
|
||||
|
||||
type
|
||||
# some nested types to check object parsing
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import unittest, json, chronicles
|
||||
import ../rpcclient, ../rpcserver
|
||||
import ../json_rpc/[rpcclient, rpcserver]
|
||||
|
||||
var srv = newRpcSocketServer(["localhost:8545"])
|
||||
var client = newRpcSocketClient()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user