diff --git a/CHANGELOG.md b/CHANGELOG.md index 988c6b1cb0..8128bbb397 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - [#3013](https://github.com/poanetwork/blockscout/pull/3013), [#3026](https://github.com/poanetwork/blockscout/pull/3026), [#3031](https://github.com/poanetwork/blockscout/pull/3031) - Raw trace of transaction on-demand - [#3000](https://github.com/poanetwork/blockscout/pull/3000) - Get rid of storing of internal transactions for simple coin transfers - [#2875](https://github.com/poanetwork/blockscout/pull/2875) - Save contract code from Parity genesis file -- [#2834](https://github.com/poanetwork/blockscout/pull/2834) - always redirect to checksummed hash +- [#2834](https://github.com/poanetwork/blockscout/pull/2834), [#3009](https://github.com/poanetwork/blockscout/pull/3009), [#3014](https://github.com/poanetwork/blockscout/pull/3014), [#3033](https://github.com/poanetwork/blockscout/pull/3033) - always redirect to checksummed hash ### Fixes - [#3034](https://github.com/poanetwork/blockscout/pull/3034) - Support stateMutability=view to define reading functions in smart-contracts @@ -15,10 +15,8 @@ - [#3024](https://github.com/poanetwork/blockscout/pull/3024) - Fix pool size default value in config - [#3021](https://github.com/poanetwork/blockscout/pull/3021), [#3022](https://github.com/poanetwork/blockscout/pull/3022) - Refine dev/test config - [#3016](https://github.com/poanetwork/blockscout/pull/3016), [#3017](https://github.com/poanetwork/blockscout/pull/3017) - Fix token instance QR code data -- [#3014](https://github.com/poanetwork/blockscout/pull/3014) - Fix checksum address feature for tokens pages - [#3012](https://github.com/poanetwork/blockscout/pull/3012) - Speedup token transfers list query - [#3011](https://github.com/poanetwork/blockscout/pull/3011) - Revert realtime fetcher small skips feature -- [#3009](https://github.com/poanetwork/blockscout/pull/3009) - Fix broken export to CSV - [#3007](https://github.com/poanetwork/blockscout/pull/3007) - Fix copy UTF8 tx input action - [#2996](https://github.com/poanetwork/blockscout/pull/2996) - Fix awesomplete lib loading in Firefox - [#2993](https://github.com/poanetwork/blockscout/pull/2993) - Fix path definition for contract verification endpoint diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex index e92b7b356c..538f8fd7f4 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex @@ -9,6 +9,7 @@ defmodule BlockScoutWeb.AddressCoinBalanceController do alias BlockScoutWeb.AddressCoinBalanceView alias Explorer.{Chain, Market} + alias Explorer.Chain.Address alias Explorer.ExchangeRates.Token alias Indexer.Fetcher.CoinBalanceOnDemand alias Phoenix.View @@ -64,7 +65,7 @@ defmodule BlockScoutWeb.AddressCoinBalanceController do coin_balance_status: CoinBalanceOnDemand.trigger_fetch(address), exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(), current_path: current_path(conn), - counters_path: address_path(conn, :address_counters, %{"id" => to_string(address_hash)}) + counters_path: address_path(conn, :address_counters, %{"id" => Address.checksum(address_hash)}) ) else :error -> diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_read_contract_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_read_contract_controller.ex index baa4193f61..130debf038 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_read_contract_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_read_contract_controller.ex @@ -9,6 +9,7 @@ defmodule BlockScoutWeb.AddressReadContractController do use BlockScoutWeb, :controller alias Explorer.{Chain, Market} + alias Explorer.Chain.Address alias Explorer.ExchangeRates.Token alias Indexer.Fetcher.CoinBalanceOnDemand @@ -32,7 +33,7 @@ defmodule BlockScoutWeb.AddressReadContractController do address: address, coin_balance_status: CoinBalanceOnDemand.trigger_fetch(address), exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(), - counters_path: address_path(conn, :address_counters, %{"id" => to_string(address_hash)}) + counters_path: address_path(conn, :address_counters, %{"id" => Address.checksum(address_hash)}) ) else _ -> diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_controller.ex index 157d338313..b7a445f67b 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_controller.ex @@ -5,6 +5,7 @@ defmodule BlockScoutWeb.AddressTokenController do alias BlockScoutWeb.AddressTokenView alias Explorer.{Chain, Market} + alias Explorer.Chain.Address alias Explorer.ExchangeRates.Token alias Indexer.Fetcher.CoinBalanceOnDemand alias Phoenix.View @@ -63,7 +64,7 @@ defmodule BlockScoutWeb.AddressTokenController do current_path: current_path(conn), coin_balance_status: CoinBalanceOnDemand.trigger_fetch(address), exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(), - counters_path: address_path(conn, :address_counters, %{"id" => to_string(address_hash)}) + counters_path: address_path(conn, :address_counters, %{"id" => Address.checksum(address_hash)}) ) else :error -> diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex index af7a4c93f4..23b393f5a3 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex @@ -4,6 +4,7 @@ defmodule BlockScoutWeb.AddressTokenTransferController do alias BlockScoutWeb.TransactionView alias Explorer.ExchangeRates.Token alias Explorer.{Chain, Market} + alias Explorer.Chain.Address alias Indexer.Fetcher.CoinBalanceOnDemand alias Phoenix.View @@ -96,7 +97,7 @@ defmodule BlockScoutWeb.AddressTokenTransferController do exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(), current_path: current_path(conn), token: token, - counters_path: address_path(conn, :address_counters, %{"id" => to_string(address_hash)}) + counters_path: address_path(conn, :address_counters, %{"id" => Address.checksum(address_hash)}) ) else :error -> @@ -178,7 +179,7 @@ defmodule BlockScoutWeb.AddressTokenTransferController do exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(), filter: params["filter"], current_path: current_path(conn), - counters_path: address_path(conn, :address_counters, %{"id" => to_string(address_hash)}) + counters_path: address_path(conn, :address_counters, %{"id" => Address.checksum(address_hash)}) ) else :error -> diff --git a/apps/explorer/lib/explorer/chain/address.ex b/apps/explorer/lib/explorer/chain/address.ex index 76ea5e85dd..1b167fbc78 100644 --- a/apps/explorer/lib/explorer/chain/address.ex +++ b/apps/explorer/lib/explorer/chain/address.ex @@ -145,7 +145,6 @@ defmodule Explorer.Chain.Address do end end - # https://github.com/rsksmart/RSKIPs/blob/master/IPs/RSKIP60.md def eth_checksum(hash) do string_hash = hash @@ -169,6 +168,7 @@ defmodule Explorer.Chain.Address do end) end + # https://github.com/rsksmart/RSKIPs/blob/master/IPs/RSKIP60.md def rsk_checksum(hash) do chain_id = NetVersion.get_version()