Skip to content

Commit 4d69f6a

Browse files
committed
add raises annotation, and return JsonRpcProvider from new
1 parent 837452c commit 4d69f6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ethers/providers/jsonrpc.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ proc jsonHeaders: seq[(string, string)] =
6262

6363
proc new*(_: type JsonRpcProvider,
6464
url=defaultUrl,
65-
pollingInterval=defaultPollingInterval): JsonRpcProvider =
65+
pollingInterval=defaultPollingInterval): JsonRpcProvider {.raises: [JsonRpcProviderError].} =
6666
var initialized: Future[void]
6767
var client: RpcClient
6868
var subscriptions: JsonRpcSubscriptions
@@ -93,7 +93,7 @@ proc new*(_: type JsonRpcProvider,
9393

9494
convertError:
9595
initialized = initialize()
96-
JsonRpcProvider(client: awaitClient(), subscriptions: awaitSubscriptions())
96+
return JsonRpcProvider(client: awaitClient(), subscriptions: awaitSubscriptions())
9797

9898
proc send*(provider: JsonRpcProvider,
9999
call: string,

0 commit comments

Comments
 (0)