Fix read contract page bug

pull/5066/head
nikitosing 3 years ago
parent 1e5d63a11d
commit 92628a1389
  1. 2
      .dialyzer-ignore
  2. 1
      CHANGELOG.md
  3. 11
      apps/explorer/lib/explorer/smart_contract/reader.ex

@ -18,7 +18,7 @@ lib/phoenix/router.ex:402
lib/block_scout_web/views/layout_view.ex:145: The call 'Elixir.Poison.Parser':'parse!'
lib/block_scout_web/views/layout_view.ex:237: The call 'Elixir.Poison.Parser':'parse!'
lib/block_scout_web/controllers/api/rpc/transaction_controller.ex:22
lib/explorer/smart_contract/reader.ex:435
lib/explorer/smart_contract/reader.ex:436
lib/indexer/fetcher/token_total_supply_on_demand.ex:16
lib/explorer/exchange_rates/source.ex:110
lib/explorer/exchange_rates/source.ex:113

@ -3,6 +3,7 @@
### Features
### Fixes
- [#5066](https://github.com/blockscout/blockscout/pull/5066) - Fix read contract page bug
- [#5071](https://github.com/blockscout/blockscout/pull/5071) - Fix write page contract tuple input
- [#5034](https://github.com/blockscout/blockscout/pull/5034) - Fix broken functions input at transation page
- [#5025](https://github.com/blockscout/blockscout/pull/5025) - Add standard input JSON files validation

@ -298,13 +298,14 @@ defmodule Explorer.SmartContract.Reader do
defp get_abi_with_method_id(abi) do
abi
|> Enum.map(fn method ->
parsed_method = [method] |> ABI.parse_specification() |> Enum.at(0)
if is_map(parsed_method) do
method_id = Map.get(parsed_method, :method_id)
with parsed_method <- [method] |> ABI.parse_specification() |> Enum.at(0),
true <- is_map(parsed_method),
method_id <- Map.get(parsed_method, :method_id),
true <- !is_nil(method_id) do
Map.put(method, "method_id", Base.encode16(method_id, case: :lower))
else
method
_ ->
method
end
end)
end

Loading…
Cancel
Save