From dfbdb442b31db4a2aa516a5451402945867171eb Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 15 Aug 2019 15:16:26 +0300 Subject: [PATCH] use method_id in query --- apps/explorer/lib/explorer/chain/log.ex | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/explorer/lib/explorer/chain/log.ex b/apps/explorer/lib/explorer/chain/log.ex index 717044d66b..3e996e2d37 100644 --- a/apps/explorer/lib/explorer/chain/log.ex +++ b/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" <> <> -> + "0x" <> hex_part -> + {number, ""} = Integer.parse(hex_part, 16) + <> = :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 )