Merge pull request #1090 from poanetwork/ams-fix-transaction-token-transfer

Fix pattern matching error when transaction does not loads to_address.smart_contract
pull/1072/head
Andrew Cravenho 6 years ago committed by GitHub
commit 0bc3c7b924
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      apps/block_scout_web/lib/block_scout_web/controllers/transaction_token_transfer_controller.ex
  2. 10
      apps/block_scout_web/test/block_scout_web/controllers/transaction_token_transfer_controller_test.exs

@ -17,6 +17,7 @@ defmodule BlockScoutWeb.TransactionTokenTransferController do
[created_contract_address: :names] => :optional,
[from_address: :names] => :optional,
[to_address: :names] => :optional,
[to_address: :smart_contract] => :optional,
:token_transfers => :optional
}
) do

@ -142,5 +142,15 @@ defmodule BlockScoutWeb.TransactionTokenTransferControllerTest do
assert is_nil(conn.assigns.next_page_params)
end
test "preloads to_address smart contract verified", %{conn: conn} do
transaction = insert(:transaction_to_verified_contract)
conn = get(conn, transaction_token_transfer_path(BlockScoutWeb.Endpoint, :index, transaction.hash))
assert html_response(conn, 200)
assert conn.assigns.transaction.hash == transaction.hash
assert conn.assigns.transaction.to_address.smart_contract != nil
end
end
end

Loading…
Cancel
Save