Contract reader: Address output fix

pull/3359/head
Victor Baranov 4 years ago
parent dcf55533ee
commit b5deb61491
  1. 2
      CHANGELOG.md
  2. 8
      apps/explorer/lib/explorer/smart_contract/reader.ex

@ -1,7 +1,7 @@
## Current ## Current
### Features ### Features
- [#2292](https://github.com/poanetwork/blockscout/pull/2292), [#3356](https://github.com/poanetwork/blockscout/pull/3356), [#3360](https://github.com/poanetwork/blockscout/pull/3360) - Add Web UI for POSDAO Staking DApp - [#2292](https://github.com/poanetwork/blockscout/pull/2292), [#3356](https://github.com/poanetwork/blockscout/pull/3356), [#3359](https://github.com/poanetwork/blockscout/pull/3359), [#3360](https://github.com/poanetwork/blockscout/pull/3360) - Add Web UI for POSDAO Staking DApp
- [#3354](https://github.com/poanetwork/blockscout/pull/3354) - Tx hash in EOA coin balance history - [#3354](https://github.com/poanetwork/blockscout/pull/3354) - Tx hash in EOA coin balance history
- [#3333](https://github.com/poanetwork/blockscout/pull/3333), [#3337](https://github.com/poanetwork/blockscout/pull/3337) - Dark forest contract custom theme - [#3333](https://github.com/poanetwork/blockscout/pull/3333), [#3337](https://github.com/poanetwork/blockscout/pull/3337) - Dark forest contract custom theme
- [#3330](https://github.com/poanetwork/blockscout/pull/3330) - Caching of address transactions counter, remove query 10_000 rows limit - [#3330](https://github.com/poanetwork/blockscout/pull/3330) - Caching of address transactions counter, remove query 10_000 rows limit

@ -415,19 +415,19 @@ defmodule Explorer.SmartContract.Reader do
end end
defp new_value(%{"type" => "address"} = output, [value], _index) do defp new_value(%{"type" => "address"} = output, [value], _index) do
Map.put_new(output, "value", bytes_to_string(value)) Map.put_new(output, "value", value)
end end
defp new_value(%{"type" => :address} = output, [value], _index) do defp new_value(%{"type" => :address} = output, [value], _index) do
Map.put_new(output, "value", bytes_to_string(value)) Map.put_new(output, "value", value)
end end
defp new_value(%{"type" => "address"} = output, values, index) do defp new_value(%{"type" => "address"} = output, values, index) do
Map.put_new(output, "value", bytes_to_string(Enum.at(values, index))) Map.put_new(output, "value", Enum.at(values, index))
end end
defp new_value(%{"type" => :address} = output, values, index) do defp new_value(%{"type" => :address} = output, values, index) do
Map.put_new(output, "value", bytes_to_string(Enum.at(values, index))) Map.put_new(output, "value", Enum.at(values, index))
end end
defp new_value(%{"type" => "bytes" <> number_rest} = output, values, index) do defp new_value(%{"type" => "bytes" <> number_rest} = output, values, index) do

Loading…
Cancel
Save