diff --git a/apps/block_scout_web/lib/block_scout_web/schema/types.ex b/apps/block_scout_web/lib/block_scout_web/schema/types.ex index bc77abf1fc..426d9909f5 100644 --- a/apps/block_scout_web/lib/block_scout_web/schema/types.ex +++ b/apps/block_scout_web/lib/block_scout_web/schema/types.ex @@ -115,9 +115,11 @@ defmodule BlockScoutWeb.Schema.Types do """ node object(:token_transfer, id_fetcher: &token_transfer_id_fetcher/2) do field(:amount, :decimal) + field(:amounts, list_of(:decimal)) field(:block_number, :integer) field(:log_index, :integer) field(:token_id, :decimal) + field(:token_ids, list_of(:decimal)) field(:from_address_hash, :address_hash) field(:to_address_hash, :address_hash) field(:token_contract_address_hash, :address_hash) diff --git a/apps/block_scout_web/test/block_scout_web/schema/query/token_transfers_test.exs b/apps/block_scout_web/test/block_scout_web/schema/query/token_transfers_test.exs index 1b02348d23..75a58b8448 100644 --- a/apps/block_scout_web/test/block_scout_web/schema/query/token_transfers_test.exs +++ b/apps/block_scout_web/test/block_scout_web/schema/query/token_transfers_test.exs @@ -4,7 +4,7 @@ defmodule BlockScoutWeb.Schema.Query.TokenTransfersTest do describe "token_transfers field" do test "with valid argument, returns all expected fields", %{conn: conn} do transaction = insert(:transaction) - token_transfer = insert(:token_transfer, transaction: transaction) + token_transfer = insert(:token_transfer, transaction: transaction, token_ids: [5], amounts: [10]) address_hash = to_string(token_transfer.token_contract_address_hash) query = """ @@ -13,9 +13,11 @@ defmodule BlockScoutWeb.Schema.Query.TokenTransfersTest do edges { node { amount + amounts block_number log_index token_id + token_ids from_address_hash to_address_hash token_contract_address_hash @@ -40,9 +42,11 @@ defmodule BlockScoutWeb.Schema.Query.TokenTransfersTest do %{ "node" => %{ "amount" => to_string(token_transfer.amount), + "amounts" => Enum.map(token_transfer.amounts, &to_string/1), "block_number" => token_transfer.block_number, "log_index" => token_transfer.log_index, "token_id" => token_transfer.token_id, + "token_ids" => Enum.map(token_transfer.token_ids, &to_string/1), "from_address_hash" => to_string(token_transfer.from_address_hash), "to_address_hash" => to_string(token_transfer.to_address_hash), "token_contract_address_hash" => to_string(token_transfer.token_contract_address_hash),