mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-02 13:43:06 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c7e351fd9 | ||
|
|
67ab667284 |
@ -14,7 +14,7 @@ Use the [Nimble][2] package manager to add `ethers` to an existing
|
||||
project. Add the following to its .nimble file:
|
||||
|
||||
```nim
|
||||
requires "ethers >= 0.7.1 & < 0.8.0"
|
||||
requires "ethers >= 0.7.3 & < 0.8.0"
|
||||
```
|
||||
|
||||
Usage
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
version = "0.7.1"
|
||||
version = "0.7.3"
|
||||
author = "Nim Ethers Authors"
|
||||
description = "library for interacting with Ethereum"
|
||||
license = "MIT"
|
||||
|
||||
@ -157,6 +157,9 @@ method subscribe*(provider: Provider,
|
||||
method unsubscribe*(subscription: Subscription) {.base, async.} =
|
||||
doAssert false, "not implemented"
|
||||
|
||||
method isSyncing*(provider: Provider): Future[bool] {.base, async.} =
|
||||
doAssert false, "not implemented"
|
||||
|
||||
proc replay*(provider: Provider, tx: Transaction, blockNumber: UInt256) {.async.} =
|
||||
# Replay transaction at block. Useful for fetching revert reasons, which will
|
||||
# be present in the raised error message. The replayed block number should
|
||||
|
||||
@ -222,6 +222,10 @@ method unsubscribe(subscription: JsonRpcSubscription) {.async.} =
|
||||
let id = subscription.id
|
||||
await subscriptions.unsubscribe(id)
|
||||
|
||||
method isSyncing*(provider: JsonRpcProvider): Future[bool] {.async.} =
|
||||
let response = await provider.send("eth_syncing")
|
||||
return response.getBool()
|
||||
|
||||
method close*(provider: JsonRpcProvider) {.async.} =
|
||||
convertError:
|
||||
let client = await provider.client
|
||||
|
||||
@ -99,3 +99,8 @@ for url in ["ws://localhost:8545", "http://localhost:8545"]:
|
||||
discard await provider.subscribe(proc(_: Block) = discard)
|
||||
expect JsonRpcProviderError:
|
||||
discard await provider.getSigner().sendTransaction(Transaction.example)
|
||||
|
||||
test "syncing":
|
||||
let isSyncing = await provider.isSyncing()
|
||||
check not isSyncing
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user