|
|
|
@ -7,11 +7,17 @@ defmodule Explorer.Workers.ImportTransaction do |
|
|
|
|
alias Explorer.Workers.ImportReceipt |
|
|
|
|
|
|
|
|
|
@dialyzer {:nowarn_function, perform: 1} |
|
|
|
|
def perform(hash) do |
|
|
|
|
def perform(hash) when is_binary(hash) do |
|
|
|
|
TransactionImporter.import(hash) |
|
|
|
|
ImportReceipt.perform_later(hash) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
@dialyzer {:nowarn_function, perform: 1} |
|
|
|
|
def perform(raw_transaction) when is_map(raw_transaction) do |
|
|
|
|
TransactionImporter.import(raw_transaction) |
|
|
|
|
ImportReceipt.perform_later(raw_transaction["hash"]) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def perform_later(hash) do |
|
|
|
|
Exq.enqueue(Exq.Enqueuer, "transactions", __MODULE__, [hash]) |
|
|
|
|
end |
|
|
|
|