|
|
@ -104,9 +104,9 @@ defmodule Indexer.Fetcher.UncleBlock do |
|
|
|
{nephew_hash_bytes, index} |
|
|
|
{nephew_hash_bytes, index} |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp run_blocks(%Blocks{blocks_params: []}, _, original_entries), do: {:retry, original_entries} |
|
|
|
def run_blocks(%Blocks{blocks_params: []}, _, original_entries), do: {:retry, original_entries} |
|
|
|
|
|
|
|
|
|
|
|
defp run_blocks( |
|
|
|
def run_blocks( |
|
|
|
%Blocks{ |
|
|
|
%Blocks{ |
|
|
|
blocks_params: blocks_params, |
|
|
|
blocks_params: blocks_params, |
|
|
|
transactions_params: transactions_params, |
|
|
|
transactions_params: transactions_params, |
|
|
@ -235,7 +235,17 @@ defmodule Indexer.Fetcher.UncleBlock do |
|
|
|
Enum.map(errors, &error_to_entry/1) |
|
|
|
Enum.map(errors, &error_to_entry/1) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp error_to_entry(%{data: %{hash: hash}}) when is_binary(hash), do: hash |
|
|
|
defp error_to_entry(%{data: %{hash: hash, index: index}}) when is_binary(hash) do |
|
|
|
|
|
|
|
{:ok, %Hash{bytes: nephew_hash_bytes}} = Hash.Full.cast(hash) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{nephew_hash_bytes, index} |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp error_to_entry(%{data: %{nephew_hash: hash, index: index}}) when is_binary(hash) do |
|
|
|
|
|
|
|
{:ok, %Hash{bytes: nephew_hash_bytes}} = Hash.Full.cast(hash) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{nephew_hash_bytes, index} |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp errors_to_iodata(errors) when is_list(errors) do |
|
|
|
defp errors_to_iodata(errors) when is_list(errors) do |
|
|
|
errors_to_iodata(errors, []) |
|
|
|
errors_to_iodata(errors, []) |
|
|
@ -251,4 +261,9 @@ defmodule Indexer.Fetcher.UncleBlock do |
|
|
|
when is_integer(code) and is_binary(message) and is_binary(hash) do |
|
|
|
when is_integer(code) and is_binary(message) and is_binary(hash) do |
|
|
|
[hash, ": (", to_string(code), ") ", message, ?\n] |
|
|
|
[hash, ": (", to_string(code), ") ", message, ?\n] |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp error_to_iodata(%{code: code, message: message, data: %{nephew_hash: hash}}) |
|
|
|
|
|
|
|
when is_integer(code) and is_binary(message) and is_binary(hash) do |
|
|
|
|
|
|
|
[hash, ": (", to_string(code), ") ", message, ?\n] |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|