Update apps/block_scout_web/lib/block_scout_web/controllers/api/v2/address_controller.ex

Co-authored-by: Maxim Filonov <53992153+sl1depengwyn@users.noreply.github.com>
pull/9056/head
Victor Baranov 11 months ago committed by Viktor Baranov
parent 9825192aba
commit 1f87efb196
  1. 6
      apps/block_scout_web/lib/block_scout_web/controllers/api/v2/address_controller.ex

@ -500,7 +500,11 @@ defmodule BlockScoutWeb.API.V2.AddressController do
@doc """
Checks if this valid address hash string, and this address is not prohibited address
"""
@spec validate_address(String.t(), any(), list()) :: {:ok, Hash.Address.t(), Address.t()}
@spec validate_address(String.t(), any(), Keyword.t()) ::
{:format, :error}
| {:not_found, {:error, :not_found}}
| {:restricted_access, true}
| {:ok, Hash.t(), Address.t()}
def validate_address(address_hash_string, params, options \\ @api_true) do
with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)},
{:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params),

Loading…
Cancel
Save