From 05e7a00731180c4e60d9e13e7d50952cda62d7c3 Mon Sep 17 00:00:00 2001 From: Den Smalonski Date: Mon, 15 Jul 2024 15:56:54 +0200 Subject: [PATCH] fix: add support of one1 in search redirect --- apps/block_scout_web/lib/block_scout_web/chain.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/block_scout_web/lib/block_scout_web/chain.ex b/apps/block_scout_web/lib/block_scout_web/chain.ex index b142d77b6ddd..b6fd431e6a20 100644 --- a/apps/block_scout_web/lib/block_scout_web/chain.ex +++ b/apps/block_scout_web/lib/block_scout_web/chain.ex @@ -56,6 +56,7 @@ defmodule BlockScoutWeb.Chain do @page_size 50 @default_paging_options %PagingOptions{page_size: @page_size + 1} @address_hash_len 40 + @address_bech32_hash_len 42 @tx_block_op_hash_len 64 def default_paging_options do @@ -89,6 +90,9 @@ defmodule BlockScoutWeb.Chain do def from_param("0x" <> number_string = param) when byte_size(number_string) == @address_hash_len, do: address_from_param(param) + def from_param("one" <> number_string = param) when byte_size(param) == @address_bech32_hash_len, + do: address_from_param(param) + def from_param("0x" <> number_string = param) when byte_size(number_string) == @tx_block_op_hash_len, do: block_or_transaction_or_operation_from_param(param)