fix the package structure to make Nimble happy

This commit is contained in:
Zahary Karadjov 2018-07-20 19:34:10 +03:00
parent d7b95877fc
commit 642fdd591f
14 changed files with 23 additions and 20 deletions

View File

@ -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)

View File

@ -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
View File

@ -0,0 +1,3 @@
import client
import clients/[socketclient, httpclient]
export client, socketclient, httpclient

3
json_rpc/rpcserver.nim Normal file
View File

@ -0,0 +1,3 @@
import server
import servers/[socketserver, httpserver]
export server, socketserver, httpserver

View File

@ -1,3 +0,0 @@
import json_rpc/client
import json_rpc/clients/[socketclient, httpclient]
export client, socketclient, httpclient

View File

@ -1,3 +0,0 @@
import json_rpc/server
import json_rpc/servers/[socketserver, httpserver]
export server, socketserver, httpserver

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -1,6 +1,6 @@
import unittest, json, strutils
import httputils, chronicles
import ../rpcserver, ../rpcclient
import ../json_rpc/[rpcserver, rpcclient]
const
TestsCount = 100

View File

@ -1,5 +1,5 @@
import unittest, json, tables, chronicles
import ../rpcserver
import ../json_rpc/rpcserver
type
# some nested types to check object parsing

View File

@ -1,5 +1,5 @@
import unittest, json, chronicles
import ../rpcclient, ../rpcserver
import ../json_rpc/[rpcclient, rpcserver]
var srv = newRpcSocketServer(["localhost:8545"])
var client = newRpcSocketClient()