use method_id in query

pull/2555/head
Ayrat Badykov 5 years ago
parent b8c7c4ca19
commit dfbdb442b3
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 8
      apps/explorer/lib/explorer/chain/log.ex

@ -117,7 +117,9 @@ defmodule Explorer.Chain.Log do
def decode(log, transaction) do
case log.first_topic do
"0x" <> <<method_id::binary-size(4), _rest::binary>> ->
"0x" <> hex_part ->
{number, ""} = Integer.parse(hex_part, 16)
<<method_id::binary-size(4), _rest::binary>> = :binary.encode_unsigned(number)
find_candidates(method_id, log, transaction)
_ ->
@ -125,11 +127,11 @@ defmodule Explorer.Chain.Log do
end
end
defp find_candidates(_method_id, log, transaction) do
defp find_candidates(method_id, log, transaction) do
candidates_query =
from(
contract_method in ContractMethod,
# where: contract_method.identifier == ^method_id,
where: contract_method.identifier == ^method_id,
limit: 3
)

Loading…
Cancel
Save