mirror of
https://github.com/codex-storage/nim-json-rpc.git
synced 2025-02-24 17:08:17 +00:00
'Fix' template issue reporting argument error, remove unused isNull proc
This commit is contained in:
parent
2038c4c15b
commit
49f2d4e32a
@ -31,8 +31,6 @@ proc call*(self: RpcClient, name: string, params: JsonNode): Future[Response] {.
|
|||||||
self.awaiting[id] = newFut
|
self.awaiting[id] = newFut
|
||||||
result = await newFut
|
result = await newFut
|
||||||
|
|
||||||
proc isNull(node: JsonNode): bool = node.kind == JNull
|
|
||||||
|
|
||||||
proc processMessage(self: RpcClient, line: string) =
|
proc processMessage(self: RpcClient, line: string) =
|
||||||
let node = parseJson(line)
|
let node = parseJson(line)
|
||||||
|
|
||||||
@ -81,9 +79,8 @@ macro generateCalls: untyped =
|
|||||||
for callName in ETHEREUM_RPC_CALLS:
|
for callName in ETHEREUM_RPC_CALLS:
|
||||||
let nameLit = ident(callName)
|
let nameLit = ident(callName)
|
||||||
result.add(quote do:
|
result.add(quote do:
|
||||||
template `nameLit`*(client: RpcClient, params: JsonNode): Future[Response] = client.call(`callName`, params)
|
proc `nameLit`*(client: RpcClient, params: JsonNode): Future[Response] {.inline.} = client.call(`callName`, params) # TODO: Back to template
|
||||||
)
|
)
|
||||||
echo result.repr
|
|
||||||
|
|
||||||
# generate all client ethereum rpc calls
|
# generate all client ethereum rpc calls
|
||||||
generateCalls()
|
generateCalls()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user