Fix checksum in query paramater of address_counters endpoint

pull/3033/head
Victor Baranov 5 years ago
parent 0cefa818d2
commit 569cd12e16
  1. 4
      CHANGELOG.md
  2. 3
      apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex
  3. 3
      apps/block_scout_web/lib/block_scout_web/controllers/address_read_contract_controller.ex
  4. 3
      apps/block_scout_web/lib/block_scout_web/controllers/address_token_controller.ex
  5. 5
      apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex
  6. 2
      apps/explorer/lib/explorer/chain/address.ex

@ -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
- [#3029](https://github.com/poanetwork/blockscout/pull/3029) - Fix transactions and blocks appearance on the main page
@ -14,10 +14,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

@ -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 ->

@ -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
_ ->

@ -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 ->

@ -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 ->

@ -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()

Loading…
Cancel
Save