|
|
|
@ -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,10 +1265,22 @@ 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: 0, |
|
|
|
|
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: 1, |
|
|
|
|
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) |
|
|
|
|
assert Enum.member?(result, first_id) |
|
|
|
@ -1263,8 +1290,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 +1344,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 +1354,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 +1371,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 +1381,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 +1396,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 +1406,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 +1423,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 +1433,15 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: first_b_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1 |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
index: 1, |
|
|
|
|
transaction_index: first_b_transaction.index, |
|
|
|
|
block_number: first_b_transaction.block_number |
|
|
|
|
======= |
|
|
|
|
index: 2, |
|
|
|
|
block_number: first_b_transaction.block_number, |
|
|
|
|
transaction_index: first_b_transaction.index |
|
|
|
|
>>>>>>> c06b04ad... fixup! Add 'block_number' and 'transaction_index' in 'internal_transaction' |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
result = |
|
|
|
@ -1398,14 +1461,24 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: pending_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 0 |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
index: 0, |
|
|
|
|
transaction_index: pending_transaction.index |
|
|
|
|
======= |
|
|
|
|
index: 1, |
|
|
|
|
>>>>>>> c06b04ad... fixup! Add 'block_number' and 'transaction_index' in 'internal_transaction' |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
insert( |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: pending_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1 |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
index: 1, |
|
|
|
|
transaction_index: pending_transaction.index |
|
|
|
|
======= |
|
|
|
|
index: 2, |
|
|
|
|
>>>>>>> c06b04ad... fixup! Add 'block_number' and 'transaction_index' in 'internal_transaction' |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
a_block = insert(:block, number: 2000) |
|
|
|
@ -1420,7 +1493,15 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: first_a_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 0 |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
index: 0, |
|
|
|
|
transaction_index: first_a_transaction.index, |
|
|
|
|
block_number: first_a_transaction.block_number |
|
|
|
|
======= |
|
|
|
|
index: 1, |
|
|
|
|
block_number: first_a_transaction.block_number, |
|
|
|
|
transaction_index: first_a_transaction.index |
|
|
|
|
>>>>>>> c06b04ad... fixup! Add 'block_number' and 'transaction_index' in 'internal_transaction' |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: second} = |
|
|
|
@ -1428,7 +1509,15 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: first_a_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1 |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
index: 1, |
|
|
|
|
transaction_index: first_a_transaction.index, |
|
|
|
|
block_number: first_a_transaction.block_number |
|
|
|
|
======= |
|
|
|
|
index: 2, |
|
|
|
|
block_number: first_a_transaction.block_number, |
|
|
|
|
transaction_index: first_a_transaction.index |
|
|
|
|
>>>>>>> c06b04ad... fixup! Add 'block_number' and 'transaction_index' in 'internal_transaction' |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
second_a_transaction = |
|
|
|
@ -1441,7 +1530,15 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: second_a_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 0 |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
index: 0, |
|
|
|
|
transaction_index: second_a_transaction.index, |
|
|
|
|
block_number: second_a_transaction.block_number |
|
|
|
|
======= |
|
|
|
|
index: 1, |
|
|
|
|
block_number: second_a_transaction.block_number, |
|
|
|
|
transaction_index: second_a_transaction.index |
|
|
|
|
>>>>>>> c06b04ad... fixup! Add 'block_number' and 'transaction_index' in 'internal_transaction' |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
%InternalTransaction{id: fourth} = |
|
|
|
@ -1449,7 +1546,15 @@ defmodule Explorer.ChainTest do |
|
|
|
|
:internal_transaction, |
|
|
|
|
transaction: second_a_transaction, |
|
|
|
|
to_address: address, |
|
|
|
|
index: 1 |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
index: 1, |
|
|
|
|
transaction_index: second_a_transaction.index, |
|
|
|
|
block_number: second_a_transaction.block_number |
|
|
|
|
======= |
|
|
|
|
index: 2, |
|
|
|
|
block_number: second_a_transaction.block_number, |
|
|
|
|
transaction_index: second_a_transaction.index |
|
|
|
|
>>>>>>> c06b04ad... fixup! Add 'block_number' and 'transaction_index' in 'internal_transaction' |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
b_block = insert(:block, number: 6000) |
|
|
|
@ -1464,7 +1569,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 +1579,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 |
|
|
|
@ -1517,7 +1626,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 +1650,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 +1709,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 +1734,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 +1773,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 +1791,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 +1810,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 +1830,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 +1851,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 +1881,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 +2181,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 +2212,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 +2412,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 +2458,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 +2498,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 +2567,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 +2585,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 +2641,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 +2655,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} = |
|
|
|
|