|
|
|
@ -70,198 +70,199 @@ defmodule Indexer.Block.FetcherTest do |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
test "with single element range that is valid imports one block", %{ |
|
|
|
|
block_fetcher: %Fetcher{json_rpc_named_arguments: json_rpc_named_arguments} = block_fetcher |
|
|
|
|
} do |
|
|
|
|
block_number = 0 |
|
|
|
|
|
|
|
|
|
if json_rpc_named_arguments[:transport] == EthereumJSONRPC.Mox do |
|
|
|
|
block_quantity = integer_to_quantity(block_number) |
|
|
|
|
miner_hash = "0x0000000000000000000000000000000000000000" |
|
|
|
|
|
|
|
|
|
res = eth_block_number_fake_response(block_quantity) |
|
|
|
|
|
|
|
|
|
case Keyword.fetch!(json_rpc_named_arguments, :variant) do |
|
|
|
|
EthereumJSONRPC.Parity -> |
|
|
|
|
EthereumJSONRPC.Mox |
|
|
|
|
|> expect(:json_rpc, fn [%{id: id, method: "eth_getBlockByNumber", params: [^block_quantity, true]}], |
|
|
|
|
_options -> |
|
|
|
|
{:ok, |
|
|
|
|
[ |
|
|
|
|
%{ |
|
|
|
|
id: id, |
|
|
|
|
jsonrpc: "2.0", |
|
|
|
|
result: %{ |
|
|
|
|
"author" => "0x0000000000000000000000000000000000000000", |
|
|
|
|
"difficulty" => "0x20000", |
|
|
|
|
"extraData" => "0x", |
|
|
|
|
"gasLimit" => "0x663be0", |
|
|
|
|
"gasUsed" => "0x0", |
|
|
|
|
"hash" => "0x5b28c1bfd3a15230c9a46b399cd0f9a6920d432e85381cc6a140b06e8410112f", |
|
|
|
|
"logsBloom" => |
|
|
|
|
"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", |
|
|
|
|
"miner" => miner_hash, |
|
|
|
|
"number" => block_quantity, |
|
|
|
|
"parentHash" => "0x0000000000000000000000000000000000000000000000000000000000000000", |
|
|
|
|
"receiptsRoot" => "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", |
|
|
|
|
"sealFields" => [ |
|
|
|
|
"0x80", |
|
|
|
|
"0xb8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" |
|
|
|
|
], |
|
|
|
|
"sha3Uncles" => "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", |
|
|
|
|
"signature" => |
|
|
|
|
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", |
|
|
|
|
"size" => "0x215", |
|
|
|
|
"stateRoot" => "0xfad4af258fd11939fae0c6c6eec9d340b1caac0b0196fd9a1bc3f489c5bf00b3", |
|
|
|
|
"step" => "0", |
|
|
|
|
"timestamp" => "0x0", |
|
|
|
|
"totalDifficulty" => "0x20000", |
|
|
|
|
"transactions" => [], |
|
|
|
|
"transactionsRoot" => "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", |
|
|
|
|
"uncles" => [] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
]} |
|
|
|
|
end) |
|
|
|
|
|> expect(:json_rpc, fn [%{id: id, method: "trace_block", params: [^block_quantity]}], _options -> |
|
|
|
|
{:ok, [%{id: id, result: []}]} |
|
|
|
|
end) |
|
|
|
|
# async requests need to be grouped in one expect because the order is non-deterministic while multiple expect |
|
|
|
|
# calls on the same name/arity are used in order |
|
|
|
|
|> expect(:json_rpc, 2, fn json, _options -> |
|
|
|
|
[request] = json |
|
|
|
|
|
|
|
|
|
case request do |
|
|
|
|
%{id: id, method: "eth_getBalance", params: [^miner_hash, ^block_quantity]} -> |
|
|
|
|
{:ok, [%{id: id, jsonrpc: "2.0", result: "0x0"}]} |
|
|
|
|
|
|
|
|
|
%{id: id, method: "trace_replayBlockTransactions", params: [^block_quantity, ["trace"]]} -> |
|
|
|
|
{:ok, [%{id: id, result: []}]} |
|
|
|
|
end |
|
|
|
|
end) |
|
|
|
|
|> expect(:json_rpc, fn [ |
|
|
|
|
%{ |
|
|
|
|
id: 0, |
|
|
|
|
jsonrpc: "2.0", |
|
|
|
|
method: "eth_getBlockByNumber", |
|
|
|
|
params: [^block_quantity, true] |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
_ -> |
|
|
|
|
{:ok, [res]} |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
EthereumJSONRPC.Geth -> |
|
|
|
|
EthereumJSONRPC.Mox |
|
|
|
|
|> expect(:json_rpc, fn [%{id: id, method: "eth_getBlockByNumber", params: [^block_quantity, true]}], |
|
|
|
|
_options -> |
|
|
|
|
{:ok, |
|
|
|
|
[ |
|
|
|
|
%{ |
|
|
|
|
id: id, |
|
|
|
|
jsonrpc: "2.0", |
|
|
|
|
result: %{ |
|
|
|
|
"difficulty" => "0x400000000", |
|
|
|
|
"extraData" => "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa", |
|
|
|
|
"gasLimit" => "0x1388", |
|
|
|
|
"gasUsed" => "0x0", |
|
|
|
|
"hash" => "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3", |
|
|
|
|
"logsBloom" => |
|
|
|
|
"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", |
|
|
|
|
"miner" => miner_hash, |
|
|
|
|
"mixHash" => "0x0000000000000000000000000000000000000000000000000000000000000000", |
|
|
|
|
"nonce" => "0x0000000000000042", |
|
|
|
|
"number" => block_quantity, |
|
|
|
|
"parentHash" => "0x0000000000000000000000000000000000000000000000000000000000000000", |
|
|
|
|
"receiptsRoot" => "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", |
|
|
|
|
"sha3Uncles" => "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", |
|
|
|
|
"size" => "0x21c", |
|
|
|
|
"stateRoot" => "0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544", |
|
|
|
|
"timestamp" => "0x0", |
|
|
|
|
"totalDifficulty" => "0x400000000", |
|
|
|
|
"transactions" => [], |
|
|
|
|
"transactionsRoot" => "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", |
|
|
|
|
"uncles" => [] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
]} |
|
|
|
|
end) |
|
|
|
|
|> expect(:json_rpc, fn [ |
|
|
|
|
%{ |
|
|
|
|
id: id, |
|
|
|
|
jsonrpc: "2.0", |
|
|
|
|
method: "eth_getBalance", |
|
|
|
|
params: [^miner_hash, ^block_quantity] |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
_options -> |
|
|
|
|
{:ok, [%{id: id, jsonrpc: "2.0", result: "0x0"}]} |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
variant_name -> |
|
|
|
|
raise ArgumentError, "Unsupported variant name (#{variant_name})" |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
%{address_hash: address_hash, block_hash: block_hash} = |
|
|
|
|
case Keyword.fetch!(json_rpc_named_arguments, :variant) do |
|
|
|
|
EthereumJSONRPC.Geth -> |
|
|
|
|
%{ |
|
|
|
|
address_hash: %Explorer.Chain.Hash{ |
|
|
|
|
byte_count: 20, |
|
|
|
|
bytes: <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>> |
|
|
|
|
}, |
|
|
|
|
block_hash: %Explorer.Chain.Hash{ |
|
|
|
|
byte_count: 32, |
|
|
|
|
bytes: |
|
|
|
|
<<212, 229, 103, 64, 248, 118, 174, 248, 192, 16, 184, 106, 64, 213, 245, 103, 69, 161, 24, 208, 144, |
|
|
|
|
106, 52, 230, 154, 236, 140, 13, 177, 203, 143, 163>> |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
EthereumJSONRPC.Parity -> |
|
|
|
|
%{ |
|
|
|
|
address_hash: %Explorer.Chain.Hash{ |
|
|
|
|
byte_count: 20, |
|
|
|
|
bytes: <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>> |
|
|
|
|
}, |
|
|
|
|
block_hash: %Explorer.Chain.Hash{ |
|
|
|
|
byte_count: 32, |
|
|
|
|
bytes: |
|
|
|
|
<<91, 40, 193, 191, 211, 161, 82, 48, 201, 164, 107, 57, 156, 208, 249, 166, 146, 13, 67, 46, 133, 56, |
|
|
|
|
28, 198, 161, 64, 176, 110, 132, 16, 17, 47>> |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
variant -> |
|
|
|
|
raise ArgumentError, "Unsupported variant (#{variant})" |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
log_bad_gateway( |
|
|
|
|
fn -> Fetcher.fetch_and_import_range(block_fetcher, block_number..block_number) end, |
|
|
|
|
fn result -> |
|
|
|
|
assert {:ok, |
|
|
|
|
%{ |
|
|
|
|
inserted: %{ |
|
|
|
|
addresses: [%Address{hash: ^address_hash}], |
|
|
|
|
blocks: [%Chain.Block{hash: ^block_hash}] |
|
|
|
|
}, |
|
|
|
|
errors: [] |
|
|
|
|
}} = result |
|
|
|
|
|
|
|
|
|
wait_for_tasks(InternalTransaction) |
|
|
|
|
wait_for_tasks(CoinBalance) |
|
|
|
|
|
|
|
|
|
assert Repo.aggregate(Chain.Block, :count, :hash) == 1 |
|
|
|
|
assert Repo.aggregate(Address, :count, :hash) == 1 |
|
|
|
|
|
|
|
|
|
address = Repo.get!(Address, address_hash) |
|
|
|
|
|
|
|
|
|
assert address.fetched_coin_balance == %Wei{value: Decimal.new(0)} |
|
|
|
|
assert address.fetched_coin_balance_block_number == 0 |
|
|
|
|
end |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|
# blinking test |
|
|
|
|
# test "with single element range that is valid imports one block", %{ |
|
|
|
|
# block_fetcher: %Fetcher{json_rpc_named_arguments: json_rpc_named_arguments} = block_fetcher |
|
|
|
|
# } do |
|
|
|
|
# block_number = 0 |
|
|
|
|
|
|
|
|
|
# if json_rpc_named_arguments[:transport] == EthereumJSONRPC.Mox do |
|
|
|
|
# block_quantity = integer_to_quantity(block_number) |
|
|
|
|
# miner_hash = "0x0000000000000000000000000000000000000000" |
|
|
|
|
|
|
|
|
|
# res = eth_block_number_fake_response(block_quantity) |
|
|
|
|
|
|
|
|
|
# case Keyword.fetch!(json_rpc_named_arguments, :variant) do |
|
|
|
|
# EthereumJSONRPC.Parity -> |
|
|
|
|
# EthereumJSONRPC.Mox |
|
|
|
|
# |> expect(:json_rpc, fn [%{id: id, method: "eth_getBlockByNumber", params: [^block_quantity, true]}], |
|
|
|
|
# _options -> |
|
|
|
|
# {:ok, |
|
|
|
|
# [ |
|
|
|
|
# %{ |
|
|
|
|
# id: id, |
|
|
|
|
# jsonrpc: "2.0", |
|
|
|
|
# result: %{ |
|
|
|
|
# "author" => "0x0000000000000000000000000000000000000000", |
|
|
|
|
# "difficulty" => "0x20000", |
|
|
|
|
# "extraData" => "0x", |
|
|
|
|
# "gasLimit" => "0x663be0", |
|
|
|
|
# "gasUsed" => "0x0", |
|
|
|
|
# "hash" => "0x5b28c1bfd3a15230c9a46b399cd0f9a6920d432e85381cc6a140b06e8410112f", |
|
|
|
|
# "logsBloom" => |
|
|
|
|
# "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", |
|
|
|
|
# "miner" => miner_hash, |
|
|
|
|
# "number" => block_quantity, |
|
|
|
|
# "parentHash" => "0x0000000000000000000000000000000000000000000000000000000000000000", |
|
|
|
|
# "receiptsRoot" => "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", |
|
|
|
|
# "sealFields" => [ |
|
|
|
|
# "0x80", |
|
|
|
|
# "0xb8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" |
|
|
|
|
# ], |
|
|
|
|
# "sha3Uncles" => "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", |
|
|
|
|
# "signature" => |
|
|
|
|
# "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", |
|
|
|
|
# "size" => "0x215", |
|
|
|
|
# "stateRoot" => "0xfad4af258fd11939fae0c6c6eec9d340b1caac0b0196fd9a1bc3f489c5bf00b3", |
|
|
|
|
# "step" => "0", |
|
|
|
|
# "timestamp" => "0x0", |
|
|
|
|
# "totalDifficulty" => "0x20000", |
|
|
|
|
# "transactions" => [], |
|
|
|
|
# "transactionsRoot" => "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", |
|
|
|
|
# "uncles" => [] |
|
|
|
|
# } |
|
|
|
|
# } |
|
|
|
|
# ]} |
|
|
|
|
# end) |
|
|
|
|
# |> expect(:json_rpc, fn [%{id: id, method: "trace_block", params: [^block_quantity]}], _options -> |
|
|
|
|
# {:ok, [%{id: id, result: []}]} |
|
|
|
|
# end) |
|
|
|
|
# # async requests need to be grouped in one expect because the order is non-deterministic while multiple expect |
|
|
|
|
# # calls on the same name/arity are used in order |
|
|
|
|
# |> expect(:json_rpc, 2, fn json, _options -> |
|
|
|
|
# [request] = json |
|
|
|
|
|
|
|
|
|
# case request do |
|
|
|
|
# %{id: id, method: "eth_getBalance", params: [^miner_hash, ^block_quantity]} -> |
|
|
|
|
# {:ok, [%{id: id, jsonrpc: "2.0", result: "0x0"}]} |
|
|
|
|
|
|
|
|
|
# %{id: id, method: "trace_replayBlockTransactions", params: [^block_quantity, ["trace"]]} -> |
|
|
|
|
# {:ok, [%{id: id, result: []}]} |
|
|
|
|
# end |
|
|
|
|
# end) |
|
|
|
|
# |> expect(:json_rpc, fn [ |
|
|
|
|
# %{ |
|
|
|
|
# id: 0, |
|
|
|
|
# jsonrpc: "2.0", |
|
|
|
|
# method: "eth_getBlockByNumber", |
|
|
|
|
# params: [^block_quantity, true] |
|
|
|
|
# } |
|
|
|
|
# ], |
|
|
|
|
# _ -> |
|
|
|
|
# {:ok, [res]} |
|
|
|
|
# end) |
|
|
|
|
|
|
|
|
|
# EthereumJSONRPC.Geth -> |
|
|
|
|
# EthereumJSONRPC.Mox |
|
|
|
|
# |> expect(:json_rpc, fn [%{id: id, method: "eth_getBlockByNumber", params: [^block_quantity, true]}], |
|
|
|
|
# _options -> |
|
|
|
|
# {:ok, |
|
|
|
|
# [ |
|
|
|
|
# %{ |
|
|
|
|
# id: id, |
|
|
|
|
# jsonrpc: "2.0", |
|
|
|
|
# result: %{ |
|
|
|
|
# "difficulty" => "0x400000000", |
|
|
|
|
# "extraData" => "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa", |
|
|
|
|
# "gasLimit" => "0x1388", |
|
|
|
|
# "gasUsed" => "0x0", |
|
|
|
|
# "hash" => "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3", |
|
|
|
|
# "logsBloom" => |
|
|
|
|
# "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", |
|
|
|
|
# "miner" => miner_hash, |
|
|
|
|
# "mixHash" => "0x0000000000000000000000000000000000000000000000000000000000000000", |
|
|
|
|
# "nonce" => "0x0000000000000042", |
|
|
|
|
# "number" => block_quantity, |
|
|
|
|
# "parentHash" => "0x0000000000000000000000000000000000000000000000000000000000000000", |
|
|
|
|
# "receiptsRoot" => "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", |
|
|
|
|
# "sha3Uncles" => "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", |
|
|
|
|
# "size" => "0x21c", |
|
|
|
|
# "stateRoot" => "0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544", |
|
|
|
|
# "timestamp" => "0x0", |
|
|
|
|
# "totalDifficulty" => "0x400000000", |
|
|
|
|
# "transactions" => [], |
|
|
|
|
# "transactionsRoot" => "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", |
|
|
|
|
# "uncles" => [] |
|
|
|
|
# } |
|
|
|
|
# } |
|
|
|
|
# ]} |
|
|
|
|
# end) |
|
|
|
|
# |> expect(:json_rpc, fn [ |
|
|
|
|
# %{ |
|
|
|
|
# id: id, |
|
|
|
|
# jsonrpc: "2.0", |
|
|
|
|
# method: "eth_getBalance", |
|
|
|
|
# params: [^miner_hash, ^block_quantity] |
|
|
|
|
# } |
|
|
|
|
# ], |
|
|
|
|
# _options -> |
|
|
|
|
# {:ok, [%{id: id, jsonrpc: "2.0", result: "0x0"}]} |
|
|
|
|
# end) |
|
|
|
|
|
|
|
|
|
# variant_name -> |
|
|
|
|
# raise ArgumentError, "Unsupported variant name (#{variant_name})" |
|
|
|
|
# end |
|
|
|
|
# end |
|
|
|
|
|
|
|
|
|
# %{address_hash: address_hash, block_hash: block_hash} = |
|
|
|
|
# case Keyword.fetch!(json_rpc_named_arguments, :variant) do |
|
|
|
|
# EthereumJSONRPC.Geth -> |
|
|
|
|
# %{ |
|
|
|
|
# address_hash: %Explorer.Chain.Hash{ |
|
|
|
|
# byte_count: 20, |
|
|
|
|
# bytes: <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>> |
|
|
|
|
# }, |
|
|
|
|
# block_hash: %Explorer.Chain.Hash{ |
|
|
|
|
# byte_count: 32, |
|
|
|
|
# bytes: |
|
|
|
|
# <<212, 229, 103, 64, 248, 118, 174, 248, 192, 16, 184, 106, 64, 213, 245, 103, 69, 161, 24, 208, 144, |
|
|
|
|
# 106, 52, 230, 154, 236, 140, 13, 177, 203, 143, 163>> |
|
|
|
|
# } |
|
|
|
|
# } |
|
|
|
|
|
|
|
|
|
# EthereumJSONRPC.Parity -> |
|
|
|
|
# %{ |
|
|
|
|
# address_hash: %Explorer.Chain.Hash{ |
|
|
|
|
# byte_count: 20, |
|
|
|
|
# bytes: <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>> |
|
|
|
|
# }, |
|
|
|
|
# block_hash: %Explorer.Chain.Hash{ |
|
|
|
|
# byte_count: 32, |
|
|
|
|
# bytes: |
|
|
|
|
# <<91, 40, 193, 191, 211, 161, 82, 48, 201, 164, 107, 57, 156, 208, 249, 166, 146, 13, 67, 46, 133, 56, |
|
|
|
|
# 28, 198, 161, 64, 176, 110, 132, 16, 17, 47>> |
|
|
|
|
# } |
|
|
|
|
# } |
|
|
|
|
|
|
|
|
|
# variant -> |
|
|
|
|
# raise ArgumentError, "Unsupported variant (#{variant})" |
|
|
|
|
# end |
|
|
|
|
|
|
|
|
|
# log_bad_gateway( |
|
|
|
|
# fn -> Fetcher.fetch_and_import_range(block_fetcher, block_number..block_number) end, |
|
|
|
|
# fn result -> |
|
|
|
|
# assert {:ok, |
|
|
|
|
# %{ |
|
|
|
|
# inserted: %{ |
|
|
|
|
# addresses: [%Address{hash: ^address_hash}], |
|
|
|
|
# blocks: [%Chain.Block{hash: ^block_hash}] |
|
|
|
|
# }, |
|
|
|
|
# errors: [] |
|
|
|
|
# }} = result |
|
|
|
|
|
|
|
|
|
# wait_for_tasks(InternalTransaction) |
|
|
|
|
# wait_for_tasks(CoinBalance) |
|
|
|
|
|
|
|
|
|
# assert Repo.aggregate(Chain.Block, :count, :hash) == 1 |
|
|
|
|
# assert Repo.aggregate(Address, :count, :hash) == 1 |
|
|
|
|
|
|
|
|
|
# address = Repo.get!(Address, address_hash) |
|
|
|
|
|
|
|
|
|
# assert address.fetched_coin_balance == %Wei{value: Decimal.new(0)} |
|
|
|
|
# assert address.fetched_coin_balance_block_number == 0 |
|
|
|
|
# end |
|
|
|
|
# ) |
|
|
|
|
# end |
|
|
|
|
|
|
|
|
|
# We can't currently index the whole Ethereum Mainnet, so we don't know what is the first full block. |
|
|
|
|
# Implement when a full block is found for Ethereum Mainnet and remove :no_geth tag |
|
|
|
|