|
|
@ -7,6 +7,7 @@ defmodule Explorer.BlockImporter do |
|
|
|
alias Explorer.Repo.NewRelic, as: Repo |
|
|
|
alias Explorer.Repo.NewRelic, as: Repo |
|
|
|
alias Explorer.Workers.ImportTransaction |
|
|
|
alias Explorer.Workers.ImportTransaction |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@dialyzer {:nowarn_function, import: 1} |
|
|
|
def import(block_number) do |
|
|
|
def import(block_number) do |
|
|
|
raw_block = download_block(block_number) |
|
|
|
raw_block = download_block(block_number) |
|
|
|
changes = extract_block(raw_block) |
|
|
|
changes = extract_block(raw_block) |
|
|
@ -19,6 +20,7 @@ defmodule Explorer.BlockImporter do |
|
|
|
import_transactions(raw_block["transactions"]) |
|
|
|
import_transactions(raw_block["transactions"]) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@dialyzer {:nowarn_function, download_block: 1} |
|
|
|
def download_block(block_number) do |
|
|
|
def download_block(block_number) do |
|
|
|
{:ok, block} = eth_get_block_by_number(block_number, false) |
|
|
|
{:ok, block} = eth_get_block_by_number(block_number, false) |
|
|
|
block |
|
|
|
block |
|
|
|