nim-json-rpc/tests/helpers.nim
coffeepots 819b6fed37
Use nim-json-serialization for RPCs (#172)
* Use nim-json-serialization for RPCs

* Add distinct serializers for RPC types

* Avoid ConvFromXtoItselfNotNeeded in testing

* Remove redundent `==` template

* Rename Eth1JsonRpc to JsonRpc

* Fix generic instantiation clash

---------

Co-authored-by: jangko <jangko128@gmail.com>
2023-12-14 08:29:11 +07:00

12 lines
272 B
Nim

import
../json_rpc/router
converter toStr*(value: distinct (string|StringOfJson)): string = string(value)
template `==`*(a: StringOfJson, b: JsonNode): bool =
parseJson(string a) == b
template `==`*(a: JsonNode, b: StringOfJson): bool =
a == parseJson(string b)