mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-02 13:43:06 +00:00
add raises annotation, and return JsonRpcProvider from new
This commit is contained in:
parent
837452c4da
commit
4d69f6aa7a
@ -62,7 +62,7 @@ proc jsonHeaders: seq[(string, string)] =
|
||||
|
||||
proc new*(_: type JsonRpcProvider,
|
||||
url=defaultUrl,
|
||||
pollingInterval=defaultPollingInterval): JsonRpcProvider =
|
||||
pollingInterval=defaultPollingInterval): JsonRpcProvider {.raises: [JsonRpcProviderError].} =
|
||||
var initialized: Future[void]
|
||||
var client: RpcClient
|
||||
var subscriptions: JsonRpcSubscriptions
|
||||
@ -93,7 +93,7 @@ proc new*(_: type JsonRpcProvider,
|
||||
|
||||
convertError:
|
||||
initialized = initialize()
|
||||
JsonRpcProvider(client: awaitClient(), subscriptions: awaitSubscriptions())
|
||||
return JsonRpcProvider(client: awaitClient(), subscriptions: awaitSubscriptions())
|
||||
|
||||
proc send*(provider: JsonRpcProvider,
|
||||
call: string,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user