Fixes broken test

pull/1034/head
robertoschneiders 6 years ago
parent 6a3b3b3c43
commit b50b80dd1e
  1. 2
      apps/block_scout_web/lib/block_scout_web/views/api/rpc/transaction_view.ex
  2. 16
      apps/block_scout_web/test/block_scout_web/controllers/api/rpc/transaction_controller_test.exs

@ -55,7 +55,7 @@ defmodule BlockScoutWeb.API.RPC.TransactionView do
"hash" => "#{transaction.hash}",
"timeStamp" => "#{DateTime.to_unix(transaction.block.timestamp)}",
"blockNumber" => "#{transaction.block_number}",
"confirmations" => "#{(max_block_number - transaction.block_number)}",
"confirmations" => "#{max_block_number - transaction.block_number}",
"success" => if(transaction.status == :ok, do: true, else: false),
"from" => "#{transaction.from_address_hash}",
"to" => "#{transaction.to_address_hash}",

@ -374,7 +374,7 @@ defmodule BlockScoutWeb.API.RPC.TransactionControllerTest do
|> with_block(block, status: :ok)
address = insert(:address)
insert(:log, address: address, transaction: transaction)
log = insert(:log, address: address, transaction: transaction)
params = %{
"module" => "transaction",
@ -382,7 +382,7 @@ defmodule BlockScoutWeb.API.RPC.TransactionControllerTest do
"txhash" => "#{transaction.hash}"
}
expected_result = %{
expected_result = %{
"hash" => "#{transaction.hash}",
"timeStamp" => "#{DateTime.to_unix(transaction.block.timestamp)}",
"blockNumber" => "#{transaction.block_number}",
@ -394,11 +394,13 @@ defmodule BlockScoutWeb.API.RPC.TransactionControllerTest do
"input" => "#{transaction.input}",
"gasLimit" => "#{transaction.gas}",
"gasUsed" => "#{transaction.gas_used}",
"logs" => [%{
"address" => "#{address}",
"data" => "0x00",
"topics" => [nil, nil, nil, nil]
}]
"logs" => [
%{
"address" => "#{address}",
"data" => "#{log.data}",
"topics" => [nil, nil, nil, nil]
}
]
}
assert response =

Loading…
Cancel
Save