Require index to be passed as an argument for internal transaction factory
pull/213/head
Tim Mecklem 7 years ago committed by GitHub
commit 149819cdf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      apps/explorer/test/explorer/chain_test.exs
  2. 2
      apps/explorer/test/explorer/indexer/block_fetcher_test.exs
  3. 1
      apps/explorer/test/support/factory.ex
  4. 2
      apps/explorer_web/test/explorer_web/features/viewing_transactions_test.exs

@ -615,7 +615,7 @@ defmodule Explorer.ChainTest do
address = insert(:address) address = insert(:address)
block = insert(:block) block = insert(:block)
transaction = insert(:transaction, block_hash: block.hash, index: 0, to_address_hash: address.hash) transaction = insert(:transaction, block_hash: block.hash, index: 0, to_address_hash: address.hash)
insert(:internal_transaction, transaction_hash: transaction.hash, to_address_hash: address.hash) insert(:internal_transaction, index: 0, to_address_hash: address.hash, transaction_hash: transaction.hash)
assert %{entries: []} = Chain.address_to_internal_transactions(address) assert %{entries: []} = Chain.address_to_internal_transactions(address)
end end
@ -686,7 +686,7 @@ defmodule Explorer.ChainTest do
test "excludes internal transaction with no siblings in the transaction" do test "excludes internal transaction with no siblings in the transaction" do
block = insert(:block) block = insert(:block)
%Transaction{hash: hash} = insert(:transaction, block_hash: block.hash, index: 0) %Transaction{hash: hash} = insert(:transaction, block_hash: block.hash, index: 0)
insert(:internal_transaction, transaction_hash: hash) insert(:internal_transaction, transaction_hash: hash, index: 0)
result = result =
hash hash

@ -52,7 +52,7 @@ defmodule Explorer.Indexer.BlockFetcherTest do
transaction = insert(:transaction, block_hash: block.hash, index: index) transaction = insert(:transaction, block_hash: block.hash, index: index)
receipt = insert(:receipt, transaction_hash: transaction.hash, transaction_index: transaction.index) receipt = insert(:receipt, transaction_hash: transaction.hash, transaction_index: transaction.index)
insert(:log, transaction_hash: receipt.transaction_hash) insert(:log, transaction_hash: receipt.transaction_hash)
insert(:internal_transaction, transaction_hash: transaction.hash) insert(:internal_transaction, transaction_hash: transaction.hash, index: 0)
end) end)
:ok :ok

@ -178,7 +178,6 @@ defmodule Explorer.Factory do
from_address_hash: insert(:address).hash, from_address_hash: insert(:address).hash,
gas: gas, gas: gas,
gas_used: gas_used, gas_used: gas_used,
index: 0,
# caller MUST suppy `index` # caller MUST suppy `index`
init: data(:internal_transaction_init), init: data(:internal_transaction_init),
trace_address: [], trace_address: [],

@ -52,7 +52,7 @@ defmodule ExplorerWeb.ViewingTransactionsTest do
internal_receipt = internal_receipt =
insert(:receipt, transaction_hash: txn_from_lincoln.hash, transaction_index: txn_from_lincoln.index) insert(:receipt, transaction_hash: txn_from_lincoln.hash, transaction_index: txn_from_lincoln.index)
internal = insert(:internal_transaction, transaction_hash: internal_receipt.transaction_hash) internal = insert(:internal_transaction, index: 0, transaction_hash: internal_receipt.transaction_hash)
{:ok, {:ok,
%{ %{

Loading…
Cancel
Save