Calm Dialyzer's nerves

pull/42/head
CJ Bryan and Desmond Bowe 7 years ago
parent 225b570765
commit 70b00ed17a
  1. 1
      lib/explorer/ethereumex_extensions.ex
  2. 4
      lib/explorer/importers/internal_transaction_importer.ex

@ -5,6 +5,7 @@ defmodule Explorer.EthereumexExtensions do
alias Ethereumex.HttpClient
@dialyzer {:nowarn_function, trace_transaction: 1}
def trace_transaction(hash) do
params = [hash, ["trace"]]
{:ok, trace} = HttpClient.request("trace_replayTransaction", params, [])

@ -9,6 +9,7 @@ defmodule Explorer.InternalTransactionImporter do
alias Explorer.Repo
alias Explorer.Transaction
@dialyzer {:nowarn_function, import: 1}
def import(hash) do
transaction = find_transaction(hash)
hash
@ -17,6 +18,7 @@ defmodule Explorer.InternalTransactionImporter do
|> persist_internal_transactions(transaction)
end
@dialyzer {:nowarn_function, download_trace: 1}
defp download_trace(hash) do
EthereumexExtensions.trace_transaction(hash)
end
@ -28,6 +30,7 @@ defmodule Explorer.InternalTransactionImporter do
Repo.one!(query)
end
@dialyzer {:nowarn_function, extract_attrs: 1}
defp extract_attrs(attrs) do
trace = attrs["trace"]
trace |> Enum.with_index() |> Enum.map(&extract_trace/1)
@ -55,6 +58,7 @@ defmodule Explorer.InternalTransactionImporter do
defp from_address(%{"action" => %{"from" => address}}), do: address
@dialyzer {:nowarn_function, persist_internal_transactions: 2}
defp persist_internal_transactions(traces, transaction) do
Enum.map(traces, fn(trace) ->
trace = Map.merge(trace, %{transaction_id: transaction.id})

Loading…
Cancel
Save