Skip to content

Commit 1a6ab42

Browse files
committed
cleanup
1 parent 3b559a9 commit 1a6ab42

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

ethers/providers/jsonrpc.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import std/tables
22
import std/uri
3-
import pkg/chronicles except `%`
3+
import pkg/chronicles
44
import pkg/eth/common/eth_types_json_serialization
55
import pkg/json_rpc/rpcclient
66
import pkg/json_rpc/errors

ethers/providers/jsonrpc/conversions.nim

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
# import std/json
21
import std/strformat
32
import std/strutils
4-
import std/sugar
5-
# import pkg/eth/common/eth_types_json_serialization
63
import pkg/chronicles except fromJson, `%`, `%*`, toJson
74
import pkg/json_rpc/jsonmarshal
85
import pkg/questionable/results
@@ -17,14 +14,7 @@ export jsonmarshal
1714
export json
1815
export chronicles except fromJson, `%`, `%*`, toJson
1916

20-
# {.push raises: [].}
21-
22-
type JsonSerializationError = object of EthersError
23-
24-
func toException*(v: ref CatchableError): ref SerializationError = (ref SerializationError)(msg: v.msg)
25-
26-
template raiseSerializationError(message: string) =
27-
raise newException(JsonSerializationError, message)
17+
{.push raises: [].}
2818

2919
proc getOrRaise*[T, E](self: ?!T, exc: typedesc[E]): T {.raises: [E].} =
3020
let val = self.valueOr:
@@ -117,10 +107,10 @@ proc fromJson*[E: TransactionStatus | TransactionType](
117107
let integer = ? fromHex[int](json.str).catch.mapFailure(SerializationError)
118108
success T(integer)
119109

120-
# Generic conversions to use nim-json instead of nim-json-serialization for
121-
# json rpc serialization purposes
122-
# writeValue => `%`
123-
# readValue => fromJson
110+
## Generic conversions to use nim-json instead of nim-json-serialization for
111+
## json rpc serialization purposes
112+
## writeValue => `%`
113+
## readValue => fromJson
124114

125115
proc writeValue*[T: not JsonNode](
126116
writer: var JsonWriter[JrpcConv],

0 commit comments

Comments
 (0)