Merge pull request #6390 from blockscout/np-fix-api-2-txs

Fix transactions response
pull/6393/head
Victor Baranov 2 years ago committed by GitHub
commit c62d296fd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 8
      apps/block_scout_web/lib/block_scout_web/views/api/v2/transaction_view.ex

@ -16,6 +16,7 @@
### Fixes
- [#6390](https://github.com/blockscout/blockscout/pull/6390) - Fix transactions responses in API v2
- [#6357](https://github.com/blockscout/blockscout/pull/6357) - Fix definitions of NETWORK_PATH, API_PATH, SOCKET_ROOT: process trailing slash
- [#6338](https://github.com/blockscout/blockscout/pull/6338) - Fix token search with space
- [#6329](https://github.com/blockscout/blockscout/pull/6329) - Prevent logger from truncating response from rust verifier service in case of an error

@ -19,14 +19,14 @@ defmodule BlockScoutWeb.API.V2.TransactionView do
ApiView.render("message.json", assigns)
end
def render("transactions.json", %{transactions: transactions, conn: conn}) do
Enum.map(transactions, &prepare_transaction(&1, conn, false))
end
def render("transactions.json", %{transactions: transactions, next_page_params: next_page_params, conn: conn}) do
%{"items" => Enum.map(transactions, &prepare_transaction(&1, conn, false)), "next_page_params" => next_page_params}
end
def render("transactions.json", %{transactions: transactions, conn: conn}) do
Enum.map(transactions, &prepare_transaction(&1, conn, false))
end
def render("transaction.json", %{transaction: transaction, conn: conn}) do
prepare_transaction(transaction, conn, true)
end

Loading…
Cancel
Save