From afe801dfc2c3ebaee755484e9e7d10a449a324b7 Mon Sep 17 00:00:00 2001 From: Viktor Baranov Date: Fri, 26 Jan 2024 16:53:06 +0300 Subject: [PATCH] Process reviewer comments --- CHANGELOG.md | 5 ----- apps/explorer/lib/explorer/chain/search.ex | 8 ++++---- apps/explorer/lib/explorer/chain/user_operation.ex | 6 +----- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52f7ceb8d6..d2c189a001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,11 +8,6 @@ - [#9169](https://github.com/blockscout/blockscout/pull/9169) - Add bridged tokens functionality to master branch - [#9158](https://github.com/blockscout/blockscout/pull/9158) - Increase shared memory for PostgreSQL containers - [#9155](https://github.com/blockscout/blockscout/pull/9155) - Allow bypassing avg block time in proxy implementation re-fetch ttl calculation -- [#9145](https://github.com/blockscout/blockscout/pull/9145) - Proxy for Account abstraction microservice -- [#9131](https://github.com/blockscout/blockscout/pull/9131) - Merge addresses stage with address referencing -- [#9072](https://github.com/blockscout/blockscout/pull/9072) - Add tracing by block logic for geth -- [#9056](https://github.com/blockscout/blockscout/pull/9056) - Noves.fi API proxy -- [#9155](https://github.com/blockscout/blockscout/pull/9155) - Allow bypassing avg block time in proxy implementation re-fetch ttl calculation - [#9148](https://github.com/blockscout/blockscout/pull/9148) - Add `/api/v2/utils/decode-calldata` - [#9145](https://github.com/blockscout/blockscout/pull/9145) - Proxy for Account abstraction microservice - [#9132](https://github.com/blockscout/blockscout/pull/9132) - Fetch token image from CoinGecko diff --git a/apps/explorer/lib/explorer/chain/search.ex b/apps/explorer/lib/explorer/chain/search.ex index 56b94d7f93..ebfc4baf47 100644 --- a/apps/explorer/lib/explorer/chain/search.ex +++ b/apps/explorer/lib/explorer/chain/search.ex @@ -98,7 +98,7 @@ defmodule Explorer.Chain.Search do basic_query |> union(^address_query) - valid_tx_or_op_hash?(string) -> + valid_full_hash?(string) -> tx_query = search_tx_query(string) if UserOperation.user_operations_enabled?() do @@ -172,7 +172,7 @@ defmodule Explorer.Chain.Search do |> select_repo(options).all() tx_result = - if valid_tx_or_op_hash?(search_query) do + if valid_full_hash?(search_query) do search_query |> search_tx_query() |> select_repo(options).all() @@ -181,7 +181,7 @@ defmodule Explorer.Chain.Search do end op_result = - if valid_tx_or_op_hash?(search_query) && UserOperation.user_operations_enabled?() do + if valid_full_hash?(search_query) && UserOperation.user_operations_enabled?() do search_query |> search_user_operation_query() |> select_repo(options).all() @@ -372,7 +372,7 @@ defmodule Explorer.Chain.Search do end end - defp valid_tx_or_op_hash?(string_input) do + defp valid_full_hash?(string_input) do case Chain.string_to_transaction_hash(string_input) do {:ok, _tx_hash} -> true _ -> false diff --git a/apps/explorer/lib/explorer/chain/user_operation.ex b/apps/explorer/lib/explorer/chain/user_operation.ex index c9c8dbda55..75300f6ea5 100644 --- a/apps/explorer/lib/explorer/chain/user_operation.ex +++ b/apps/explorer/lib/explorer/chain/user_operation.ex @@ -68,10 +68,6 @@ defmodule Explorer.Chain.UserOperation do end def user_operations_enabled? do - if Microservice.check_enabled(Explorer.MicroserviceInterfaces.AccountAbstraction) == :ok do - true - else - false - end + Microservice.check_enabled(Explorer.MicroserviceInterfaces.AccountAbstraction) == :ok end end