fix: match more explicitly on ABI decoding result

pull/1172/head
zachdaniel 6 years ago
parent 9d620f2530
commit 04ae8cf52b
  1. 4
      apps/explorer/lib/explorer/chain/log.ex

@ -5,7 +5,7 @@ defmodule Explorer.Chain.Log do
require Logger
alias ABI.Event
alias ABI.{Event, FunctionSelector}
alias Explorer.Chain.{Address, Data, Hash, Transaction}
@required_attrs ~w(address_hash data index transaction_hash)a
@ -117,7 +117,7 @@ defmodule Explorer.Chain.Log do
def decode(_log, _transaction), do: {:error, :contract_not_verified}
defp find_and_decode(abi, log, transaction) do
with {selector, mapping} <-
with {%FunctionSelector{} = selector, mapping} <-
abi
|> ABI.parse_specification(include_events?: true)
|> Event.find_and_decode(

Loading…
Cancel
Save