fix: add preloads for tx summary endpoint (#10261)

pull/10265/head
Maxim Filonov 5 months ago committed by GitHub
parent a600119d73
commit ed5e3e36c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 23
      apps/block_scout_web/lib/block_scout_web/microservice_interfaces/transaction_interpretation.ex
  2. 9
      apps/block_scout_web/lib/block_scout_web/views/api/v2/optimism_view.ex
  3. 9
      apps/block_scout_web/lib/block_scout_web/views/api/v2/polygon_edge_view.ex
  4. 6
      apps/block_scout_web/lib/block_scout_web/views/api/v2/shibarium_view.ex

@ -139,10 +139,8 @@ defmodule BlockScoutWeb.MicroserviceInterfaces.TransactionInterpretation do
full_options =
[
necessity_by_association: %{
[from_address: :smart_contract] => :optional,
[to_address: :smart_contract] => :optional,
[from_address: :names] => :optional,
[to_address: :names] => :optional
[from_address: [:names, :smart_contract, :proxy_implementations]] => :optional,
[to_address: [:names, :smart_contract, :proxy_implementations]] => :optional
}
]
|> Keyword.merge(@api_true)
@ -158,9 +156,7 @@ defmodule BlockScoutWeb.MicroserviceInterfaces.TransactionInterpretation do
log_options =
[
necessity_by_association: %{
[address: :names] => :optional,
[address: :smart_contract] => :optional,
address: :optional
[address: [:names, :smart_contract, :proxy_implementations]] => :optional
},
limit: @items_limit
]
@ -180,10 +176,8 @@ defmodule BlockScoutWeb.MicroserviceInterfaces.TransactionInterpretation do
token_transfer_options =
[
necessity_by_association: %{
[from_address: :smart_contract] => :optional,
[to_address: :smart_contract] => :optional,
[from_address: :names] => :optional,
[to_address: :names] => :optional,
[from_address: [:names, :smart_contract, :proxy_implementations]] => :optional,
[to_address: [:names, :smart_contract, :proxy_implementations]] => :optional,
:token => :optional
}
]
@ -203,9 +197,7 @@ defmodule BlockScoutWeb.MicroserviceInterfaces.TransactionInterpretation do
full_options =
[
necessity_by_association: %{
[address: :names] => :optional,
[address: :smart_contract] => :optional,
address: :optional
[address: [:names, :smart_contract, :proxy_implementations]] => :optional
}
]
|> Keyword.merge(@api_true)
@ -253,7 +245,8 @@ defmodule BlockScoutWeb.MicroserviceInterfaces.TransactionInterpretation do
[
necessity_by_association: %{
:names => :optional,
:smart_contract => :optional
:smart_contract => :optional,
:proxy_implementations => :optional
},
api?: true
],

@ -169,7 +169,14 @@ defmodule BlockScoutWeb.API.V2.OptimismView do
{:ok, address} <-
Chain.hash_to_address(
w.from,
[necessity_by_association: %{:names => :optional, :smart_contract => :optional}, api?: true],
[
necessity_by_association: %{
:names => :optional,
:smart_contract => :optional,
:proxy_implementations => :optional
},
api?: true
],
false
) do
{address, address.hash}

@ -86,7 +86,14 @@ defmodule BlockScoutWeb.API.V2.PolygonEdgeView do
{:ok, address} <-
Chain.hash_to_address(
hash,
[necessity_by_association: %{:names => :optional, :smart_contract => :optional}, api?: true],
[
necessity_by_association: %{
:names => :optional,
:smart_contract => :optional,
:proxy_implementations => :optional
},
api?: true
],
false
) do
{address, address.hash}

@ -59,7 +59,11 @@ defmodule BlockScoutWeb.API.V2.ShibariumView do
|> Enum.reject(&is_nil(&1))
|> Enum.uniq()
|> Chain.hashes_to_addresses(
necessity_by_association: %{:names => :optional, :smart_contract => :optional},
necessity_by_association: %{
:names => :optional,
:smart_contract => :optional,
:proxy_implementations => :optional
},
api?: true
)
|> Enum.into(%{}, &{&1.hash, Helper.address_with_info(conn, &1, &1.hash, true)})

Loading…
Cancel
Save