|
|
|
@ -193,7 +193,12 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|> with_block() |
|
|
|
|
|
|
|
|
|
%InternalTransaction{created_contract_address: address} = |
|
|
|
|
insert(:internal_transaction_create, transaction: transaction, index: 0) |
|
|
|
|
insert(:internal_transaction_create, |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: 0, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
assert [] == Chain.address_to_transactions(address) |
|
|
|
|
end |
|
|
|
@ -687,10 +692,20 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|> insert() |
|
|
|
|
|> with_block() |
|
|
|
|
|
|
|
|
|
insert(:internal_transaction, transaction: transaction, index: 0) |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: 0, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
Enum.each(1..3, fn index -> |
|
|
|
|
insert(:internal_transaction_create, transaction: transaction, index: index) |
|
|
|
|
insert(:internal_transaction_create, |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: index, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
assert {:ok, %Transaction{hash: ^hash_with_block}} = Chain.hash_to_transaction(hash_with_block) |
|
|
|
@ -1250,12 +1265,28 @@ defmodule Explorer.ChainTest do |
|
|
|
|
transaction = insert(:transaction) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: first_id} = |
|
|
|
|
insert(:internal_transaction, index: 0, transaction: transaction, to_address: address) |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
index: 1, |
|
|
|
|
transaction: transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: second_id} = |
|
|
|
|
insert(:internal_transaction, index: 1, transaction: transaction, to_address: address) |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
index: 2, |
|
|
|
|
transaction: transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
result = |
|
|
|
|
address |
|
|
|
|
|> Chain.address_to_internal_transactions() |
|
|
|
|
|> Enum.map(& &1.id) |
|
|
|
|
|
|
|
|
|
result = address |> Chain.address_to_internal_transactions() |> Enum.map(& &1.id) |
|
|
|
|
assert Enum.member?(result, first_id) |
|
|
|
|
assert Enum.member?(result, second_id) |
|
|
|
|
end |
|
|
|
@ -1263,8 +1294,22 @@ defmodule Explorer.ChainTest do |
|
|
|
|
test "loads associations in necessity_by_association" do |
|
|
|
|
address = insert(:address) |
|
|
|
|
transaction = insert(:transaction, to_address: address) |
|
|
|
|
insert(:internal_transaction, transaction: transaction, to_address: address, index: 0) |
|
|
|
|
insert(:internal_transaction, transaction: transaction, to_address: address, index: 1) |
|
|
|
|
|
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
transaction: transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 0, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
transaction: transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
assert [ |
|
|
|
|
%InternalTransaction{ |
|
|
|
@ -1303,7 +1348,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: pending_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 0 |
|
|
|
|
index: 1, |
|
|
|
|
block_number: pending_transaction.block_number, |
|
|
|
|
transaction_index: pending_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: second_pending} = |
|
|
|
@ -1311,7 +1358,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: pending_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1 |
|
|
|
|
index: 2, |
|
|
|
|
block_number: pending_transaction.block_number, |
|
|
|
|
transaction_index: pending_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
a_block = insert(:block, number: 2000) |
|
|
|
@ -1326,7 +1375,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: first_a_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 0 |
|
|
|
|
index: 1, |
|
|
|
|
block_number: first_a_transaction.block_number, |
|
|
|
|
transaction_index: first_a_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: second} = |
|
|
|
@ -1334,7 +1385,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: first_a_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1 |
|
|
|
|
index: 2, |
|
|
|
|
block_number: first_a_transaction.block_number, |
|
|
|
|
transaction_index: first_a_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
second_a_transaction = |
|
|
|
@ -1347,7 +1400,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: second_a_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 0 |
|
|
|
|
index: 1, |
|
|
|
|
block_number: second_a_transaction.block_number, |
|
|
|
|
transaction_index: second_a_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: fourth} = |
|
|
|
@ -1355,7 +1410,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: second_a_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1 |
|
|
|
|
index: 2, |
|
|
|
|
block_number: second_a_transaction.block_number, |
|
|
|
|
transaction_index: second_a_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
b_block = insert(:block, number: 6000) |
|
|
|
@ -1370,7 +1427,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: first_b_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 0 |
|
|
|
|
index: 1, |
|
|
|
|
block_number: first_b_transaction.block_number, |
|
|
|
|
transaction_index: first_b_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: sixth} = |
|
|
|
@ -1378,7 +1437,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: first_b_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1 |
|
|
|
|
index: 2, |
|
|
|
|
block_number: first_b_transaction.block_number, |
|
|
|
|
transaction_index: first_b_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
result = |
|
|
|
@ -1398,14 +1459,14 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: pending_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 0 |
|
|
|
|
index: 1 |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
insert( |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: pending_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1 |
|
|
|
|
index: 2 |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
a_block = insert(:block, number: 2000) |
|
|
|
@ -1420,7 +1481,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: first_a_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 0 |
|
|
|
|
index: 1, |
|
|
|
|
block_number: first_a_transaction.block_number, |
|
|
|
|
transaction_index: first_a_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: second} = |
|
|
|
@ -1428,7 +1491,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: first_a_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1 |
|
|
|
|
index: 2, |
|
|
|
|
block_number: first_a_transaction.block_number, |
|
|
|
|
transaction_index: first_a_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
second_a_transaction = |
|
|
|
@ -1441,7 +1506,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: second_a_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 0 |
|
|
|
|
index: 1, |
|
|
|
|
block_number: second_a_transaction.block_number, |
|
|
|
|
transaction_index: second_a_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: fourth} = |
|
|
|
@ -1449,7 +1516,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: second_a_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1 |
|
|
|
|
index: 2, |
|
|
|
|
block_number: second_a_transaction.block_number, |
|
|
|
|
transaction_index: second_a_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
b_block = insert(:block, number: 6000) |
|
|
|
@ -1464,7 +1533,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: first_b_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 0 |
|
|
|
|
index: 1, |
|
|
|
|
block_number: first_b_transaction.block_number, |
|
|
|
|
transaction_index: first_b_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: sixth} = |
|
|
|
@ -1472,7 +1543,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: first_b_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1 |
|
|
|
|
index: 2, |
|
|
|
|
block_number: first_b_transaction.block_number, |
|
|
|
|
transaction_index: first_b_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
# When paged, internal transactions need an associated block number, so `second_pending` and `first_pending` are |
|
|
|
@ -1485,7 +1558,7 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|> Enum.map(& &1.id) |
|
|
|
|
|
|
|
|
|
# block number ==, transaction index ==, internal transaction index < |
|
|
|
|
assert [fifth, fourth, third, second, first] == |
|
|
|
|
assert [fourth, third, second, first] == |
|
|
|
|
address |
|
|
|
|
|> Chain.address_to_internal_transactions( |
|
|
|
|
paging_options: %PagingOptions{key: {6000, 0, 1}, page_size: 8} |
|
|
|
@ -1517,7 +1590,13 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|> insert(to_address: address) |
|
|
|
|
|> with_block() |
|
|
|
|
|
|
|
|
|
insert(:internal_transaction, index: 0, to_address: address, transaction: transaction) |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
index: 0, |
|
|
|
|
to_address: address, |
|
|
|
|
transaction: transaction, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
assert Enum.empty?(Chain.address_to_internal_transactions(address)) |
|
|
|
|
end |
|
|
|
@ -1535,7 +1614,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction_create, |
|
|
|
|
index: 0, |
|
|
|
|
from_address: address, |
|
|
|
|
transaction: transaction |
|
|
|
|
transaction: transaction, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
actual = Enum.at(Chain.address_to_internal_transactions(address), 0) |
|
|
|
@ -1592,8 +1673,21 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|> insert() |
|
|
|
|
|> with_block(block) |
|
|
|
|
|
|
|
|
|
first = insert(:internal_transaction, transaction: transaction, index: 0) |
|
|
|
|
second = insert(:internal_transaction, transaction: transaction, index: 1) |
|
|
|
|
first = |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: 0, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
second = |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: 1, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
results = [internal_transaction | _] = Chain.transaction_to_internal_transactions(transaction) |
|
|
|
|
|
|
|
|
@ -1604,7 +1698,13 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|
|
|
|
|
test "with transaction with internal transactions loads associations with in necessity_by_association" do |
|
|
|
|
transaction = insert(:transaction) |
|
|
|
|
insert(:internal_transaction_create, transaction: transaction, index: 0) |
|
|
|
|
|
|
|
|
|
insert(:internal_transaction_create, |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: 0, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
assert [ |
|
|
|
|
%InternalTransaction{ |
|
|
|
@ -1637,7 +1737,12 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|> insert() |
|
|
|
|
|> with_block() |
|
|
|
|
|
|
|
|
|
insert(:internal_transaction, transaction: transaction, index: 0) |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: 0, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
result = Chain.transaction_to_internal_transactions(transaction) |
|
|
|
|
|
|
|
|
@ -1650,7 +1755,13 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|> insert() |
|
|
|
|
|> with_block() |
|
|
|
|
|
|
|
|
|
expected = insert(:internal_transaction_create, index: 0, transaction: transaction) |
|
|
|
|
expected = |
|
|
|
|
insert(:internal_transaction_create, |
|
|
|
|
index: 0, |
|
|
|
|
transaction: transaction, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
actual = Enum.at(Chain.transaction_to_internal_transactions(transaction), 0) |
|
|
|
|
|
|
|
|
@ -1663,7 +1774,14 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|> insert() |
|
|
|
|
|> with_block() |
|
|
|
|
|
|
|
|
|
expected = insert(:internal_transaction, index: 0, transaction: transaction, type: :reward) |
|
|
|
|
expected = |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
index: 0, |
|
|
|
|
transaction: transaction, |
|
|
|
|
type: :reward, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
actual = Enum.at(Chain.transaction_to_internal_transactions(transaction), 0) |
|
|
|
|
|
|
|
|
@ -1676,7 +1794,15 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|> insert() |
|
|
|
|
|> with_block() |
|
|
|
|
|
|
|
|
|
expected = insert(:internal_transaction, index: 0, transaction: transaction, gas: nil, type: :suicide) |
|
|
|
|
expected = |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
index: 0, |
|
|
|
|
transaction: transaction, |
|
|
|
|
gas: nil, |
|
|
|
|
type: :suicide, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
actual = Enum.at(Chain.transaction_to_internal_transactions(transaction), 0) |
|
|
|
|
|
|
|
|
@ -1689,8 +1815,21 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|> insert() |
|
|
|
|
|> with_block() |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: first_id} = insert(:internal_transaction, transaction: transaction, index: 0) |
|
|
|
|
%InternalTransaction{id: second_id} = insert(:internal_transaction, transaction: transaction, index: 1) |
|
|
|
|
%InternalTransaction{id: first_id} = |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: 0, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: second_id} = |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: 1, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
result = |
|
|
|
|
transaction |
|
|
|
@ -1706,8 +1845,21 @@ defmodule Explorer.ChainTest do |
|
|
|
|
|> insert() |
|
|
|
|
|> with_block() |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: first_id} = insert(:internal_transaction, transaction: transaction, index: 0) |
|
|
|
|
%InternalTransaction{id: second_id} = insert(:internal_transaction, transaction: transaction, index: 1) |
|
|
|
|
%InternalTransaction{id: first_id} = |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: 0, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: second_id} = |
|
|
|
|
insert(:internal_transaction, |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: 1, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
assert [^first_id, ^second_id] = |
|
|
|
|
transaction |
|
|
|
@ -1993,7 +2145,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: 0, |
|
|
|
|
created_contract_address: created_contract_address, |
|
|
|
|
created_contract_code: smart_contract_bytecode |
|
|
|
|
created_contract_code: smart_contract_bytecode, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
assert Chain.smart_contract_bytecode(created_contract_address.hash) == smart_contract_bytecode |
|
|
|
@ -2022,7 +2176,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
transaction: transaction, |
|
|
|
|
index: 0, |
|
|
|
|
created_contract_address: created_contract_address, |
|
|
|
|
created_contract_code: smart_contract_bytecode |
|
|
|
|
created_contract_code: smart_contract_bytecode, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
valid_attrs = %{ |
|
|
|
@ -2220,7 +2376,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction_create, |
|
|
|
|
created_contract_address: created_contract_address, |
|
|
|
|
index: 0, |
|
|
|
|
transaction: transaction |
|
|
|
|
transaction: transaction, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
balance = insert(:unfetched_balance, address_hash: created_contract_address.hash, block_number: block.number) |
|
|
|
@ -2264,7 +2422,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction_create, |
|
|
|
|
from_address: from_address, |
|
|
|
|
index: 0, |
|
|
|
|
transaction: transaction |
|
|
|
|
transaction: transaction, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
balance = insert(:unfetched_balance, address_hash: from_address.hash, block_number: block.number) |
|
|
|
@ -2302,7 +2462,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction_create, |
|
|
|
|
to_address: to_address, |
|
|
|
|
index: 0, |
|
|
|
|
transaction: transaction |
|
|
|
|
transaction: transaction, |
|
|
|
|
block_number: transaction.block_number, |
|
|
|
|
transaction_index: transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
balance = insert(:unfetched_balance, address_hash: to_address.hash, block_number: block.number) |
|
|
|
@ -2369,7 +2531,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction_create, |
|
|
|
|
from_address: miner, |
|
|
|
|
index: 0, |
|
|
|
|
transaction: from_internal_transaction_transaction |
|
|
|
|
transaction: from_internal_transaction_transaction, |
|
|
|
|
block_number: from_internal_transaction_transaction.block_number, |
|
|
|
|
transaction_index: from_internal_transaction_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
insert(:unfetched_balance, address_hash: miner.hash, block_number: from_internal_transaction_block.number) |
|
|
|
@ -2385,7 +2549,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction_create, |
|
|
|
|
index: 0, |
|
|
|
|
to_address: miner, |
|
|
|
|
transaction: to_internal_transaction_transaction |
|
|
|
|
transaction: to_internal_transaction_transaction, |
|
|
|
|
block_number: to_internal_transaction_transaction.block_number, |
|
|
|
|
transaction_index: to_internal_transaction_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
insert(:unfetched_balance, address_hash: miner.hash, block_number: to_internal_transaction_block.number) |
|
|
|
@ -2439,7 +2605,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction_create, |
|
|
|
|
from_address: miner, |
|
|
|
|
index: 0, |
|
|
|
|
transaction: from_internal_transaction_transaction |
|
|
|
|
transaction: from_internal_transaction_transaction, |
|
|
|
|
block_number: from_internal_transaction_transaction.block_number, |
|
|
|
|
transaction_index: from_internal_transaction_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
to_internal_transaction_transaction = |
|
|
|
@ -2451,7 +2619,9 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction_create, |
|
|
|
|
to_address: miner, |
|
|
|
|
index: 0, |
|
|
|
|
transaction: to_internal_transaction_transaction |
|
|
|
|
transaction: to_internal_transaction_transaction, |
|
|
|
|
block_number: to_internal_transaction_transaction.block_number, |
|
|
|
|
transaction_index: to_internal_transaction_transaction.index |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
{:ok, balance_fields_list} = |
|
|
|
|