Means that both Block.Fetchers, realtime and catchup, now handle fetch errors. The Block.Catchup.Fetcher will retry those blocks that failed to fetch while importing the rest that did fetch instead of refetching the whole batch.pull/1135/head
parent
d43a8c6133
commit
3499155cdb
@ -0,0 +1,11 @@ |
||||
defmodule EthereumJSONRPC.Block.ByNumber do |
||||
@moduledoc """ |
||||
Block format as returned by [`eth_getBlockByNumber`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblockbyhash) |
||||
""" |
||||
|
||||
import EthereumJSONRPC, only: [integer_to_quantity: 1] |
||||
|
||||
def request(%{id: id, number: number}) do |
||||
EthereumJSONRPC.request(%{id: id, method: "eth_getBlockByNumber", params: [integer_to_quantity(number), true]}) |
||||
end |
||||
end |
@ -1,14 +0,0 @@ |
||||
defmodule EthereumJSONRPC.Blocks.ByHash do |
||||
@moduledoc """ |
||||
Blocks format as returned by [`eth_getBlockByHash`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblockbyhash) |
||||
from batch requests. |
||||
""" |
||||
|
||||
alias EthereumJSONRPC.Block |
||||
|
||||
def requests(id_to_params) when is_map(id_to_params) do |
||||
Enum.map(id_to_params, fn {id, %{hash: hash}} -> |
||||
Block.ByHash.request(%{id: id, hash: hash}) |
||||
end) |
||||
end |
||||
end |
Loading…
Reference in new issue