21 Commits

Author SHA1 Message Date
Zahary Karadjov
6fbaeb61ca
Switch to json_serialition.JsonString to facilitate Chronicles logging 2020-03-18 18:14:29 +02:00
Zahary Karadjov
f53e0b960b
Fix all tests 2020-03-17 22:05:42 +02:00
Zahary Karadjov
d19de19128
Refactor the router to allow bypassing the use of std/json
The users will be now able to write RPC handlers returning the
distinct type `StringOfJson`. This will bypass any use of the
standard library's JsonNode type and its serialization routines.

The change was motivated by the integration of JSON-RPC in
status-im/nim-beacon-chain where most of the data types cannot
be handled by Nim's std lib or json-rpc's jsonmarshal module.
2020-03-17 20:38:52 +02:00
Zahary Karadjov
4d1d2577e9
Trivial changes required for the beacon node integration 2020-03-17 00:17:10 +02:00
Zahary Karadjov
9b401994a1
Follow the convention of naming types as UpperCase 2020-01-21 18:50:50 +02:00
Zahary Karadjov
6f9da4ba8a
Make the RPC procs async again 2020-01-21 18:49:52 +02:00
Ștefan Talpalaru
72a99cc977
replace getCurrentExceptionMsg() and delete some unused imports 2019-12-02 12:26:09 +01:00
kdeme
707567c7ab Check if method field is a string 2019-05-17 11:58:51 +03:00
kdeme
40411aef5a Add JObject check to resolve possible unhandled exception 2019-04-29 22:04:56 +03:00
Mamy Ratsimbazafy
53ed44dfa5
Rebrand asyncdispatch2 to chronos (#50) 2019-02-06 18:27:58 +01:00
Ștefan Talpalaru
64a9999ac9 another {.gcsafe.} pragma, just for Windows 2019-01-17 18:35:15 +02:00
Zahary Karadjov
26953344c3 Turn some potentially dangerous templates into functions
Be careful when creating templates. If the input parameters are
referenced within the body multiple times, this may lead to multiple
evaluations of functions with side-effects.
2018-11-12 23:51:24 +02:00
Zahary Karadjov
642fdd591f fix the package structure to make Nimble happy 2018-07-20 19:34:10 +03:00
coffeepots
3da2738e27 Fix gcsafe error in debug, use getOrDefault instead of {} 2018-07-12 09:23:38 +01:00
coffeepots
49085bbd28 Simplify error trapping 2018-07-11 21:49:08 +01:00
coffeepots
f09aeffd65 Fix incompatibility between returning JSON errors and fixed types 2018-07-11 19:16:11 +01:00
coffeepots
3b8e736f35 Wrap RPC exceptions in JSON 2018-07-11 18:27:50 +01:00
coffeepots
ceec0e7690 Renamed ifRoute to tryRoute 2018-07-10 16:51:26 +01:00
coffeepots
eb23c46949 Split route into json only and string version, fix lack of terminator 2018-07-10 16:07:47 +01:00
coffeepots
f60a648968 Move remaining rpc routing to router.nim 2018-07-10 10:39:09 +01:00
coffeepots
cf44cc552d Remove DSL, add router and simplify server 2018-07-06 17:47:43 +01:00