|
|
@ -185,14 +185,15 @@ defmodule BlockScoutWeb.AddressTransactionController do |
|
|
|
%{ |
|
|
|
%{ |
|
|
|
"address_id" => address_hash_string, |
|
|
|
"address_id" => address_hash_string, |
|
|
|
"from_period" => from_period, |
|
|
|
"from_period" => from_period, |
|
|
|
"to_period" => to_period |
|
|
|
"to_period" => to_period, |
|
|
|
|
|
|
|
"recaptcha_response" => recaptcha_response |
|
|
|
}, |
|
|
|
}, |
|
|
|
csv_export_module |
|
|
|
csv_export_module |
|
|
|
) |
|
|
|
) |
|
|
|
when is_binary(address_hash_string) do |
|
|
|
when is_binary(address_hash_string) do |
|
|
|
with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), |
|
|
|
with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), |
|
|
|
{:ok, address} <- Chain.hash_to_address(address_hash), |
|
|
|
{:ok, address} <- Chain.hash_to_address(address_hash), |
|
|
|
true <- Application.get_env(:block_scout_web, :recaptcha)[:is_disabled] do |
|
|
|
{:recaptcha, true} <- {:recaptcha, captcha_helper().recaptcha_passed?(recaptcha_response)} do |
|
|
|
address |
|
|
|
address |
|
|
|
|> csv_export_module.export(from_period, to_period) |
|
|
|
|> csv_export_module.export(from_period, to_period) |
|
|
|
|> Enum.reduce_while(put_resp_params(conn), fn chunk, conn -> |
|
|
|
|> Enum.reduce_while(put_resp_params(conn), fn chunk, conn -> |
|
|
@ -211,7 +212,7 @@ defmodule BlockScoutWeb.AddressTransactionController do |
|
|
|
{:error, :not_found} -> |
|
|
|
{:error, :not_found} -> |
|
|
|
not_found(conn) |
|
|
|
not_found(conn) |
|
|
|
|
|
|
|
|
|
|
|
false -> |
|
|
|
{:recaptcha, false} -> |
|
|
|
not_found(conn) |
|
|
|
not_found(conn) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
@ -221,15 +222,14 @@ defmodule BlockScoutWeb.AddressTransactionController do |
|
|
|
%{ |
|
|
|
%{ |
|
|
|
"address_id" => address_hash_string, |
|
|
|
"address_id" => address_hash_string, |
|
|
|
"from_period" => from_period, |
|
|
|
"from_period" => from_period, |
|
|
|
"to_period" => to_period, |
|
|
|
"to_period" => to_period |
|
|
|
"recaptcha_response" => recaptcha_response |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
csv_export_module |
|
|
|
csv_export_module |
|
|
|
) |
|
|
|
) |
|
|
|
when is_binary(address_hash_string) do |
|
|
|
when is_binary(address_hash_string) do |
|
|
|
with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), |
|
|
|
with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), |
|
|
|
{:ok, address} <- Chain.hash_to_address(address_hash), |
|
|
|
{:ok, address} <- Chain.hash_to_address(address_hash), |
|
|
|
{:recaptcha, true} <- {:recaptcha, captcha_helper().recaptcha_passed?(recaptcha_response)} do |
|
|
|
true <- Application.get_env(:block_scout_web, :recaptcha)[:is_disabled] do |
|
|
|
address |
|
|
|
address |
|
|
|
|> csv_export_module.export(from_period, to_period) |
|
|
|
|> csv_export_module.export(from_period, to_period) |
|
|
|
|> Enum.reduce_while(put_resp_params(conn), fn chunk, conn -> |
|
|
|
|> Enum.reduce_while(put_resp_params(conn), fn chunk, conn -> |
|
|
@ -248,7 +248,7 @@ defmodule BlockScoutWeb.AddressTransactionController do |
|
|
|
{:error, :not_found} -> |
|
|
|
{:error, :not_found} -> |
|
|
|
not_found(conn) |
|
|
|
not_found(conn) |
|
|
|
|
|
|
|
|
|
|
|
{:recaptcha, false} -> |
|
|
|
false -> |
|
|
|
not_found(conn) |
|
|
|
not_found(conn) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|