diff --git a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/log.ex b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/log.ex index c9a6fd08e6..1ebc1b476c 100644 --- a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/log.ex +++ b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/log.ex @@ -84,6 +84,7 @@ defmodule EthereumJSONRPC.Log do %{ "address" => address_hash, "blockNumber" => block_number, + "blockHash" => block_hash, "data" => data, "logIndex" => index, "topics" => topics, @@ -93,6 +94,7 @@ defmodule EthereumJSONRPC.Log do %{ address_hash: address_hash, block_number: block_number, + block_hash: block_hash, data: data, index: index, transaction_hash: transaction_hash diff --git a/apps/explorer/lib/explorer/chain/import/runner/token_transfers.ex b/apps/explorer/lib/explorer/chain/import/runner/token_transfers.ex index 28b1f5ebd3..3935fb53b5 100644 --- a/apps/explorer/lib/explorer/chain/import/runner/token_transfers.ex +++ b/apps/explorer/lib/explorer/chain/import/runner/token_transfers.ex @@ -55,7 +55,7 @@ defmodule Explorer.Chain.Import.Runner.TokenTransfers do on_conflict = Map.get_lazy(options, :on_conflict, &default_on_conflict/0) # Enforce TokenTransfer ShareLocks order (see docs: sharelocks.md) - ordered_changes_list = Enum.sort_by(changes_list, &{&1.transaction_hash, &1.log_index}) + ordered_changes_list = Enum.sort_by(changes_list, &{&1.transaction_hash, &1.block_hash, &1.log_index}) {:ok, _} = Import.insert_changes_list( diff --git a/apps/explorer/lib/explorer/chain/token_transfer.ex b/apps/explorer/lib/explorer/chain/token_transfer.ex index 5eced56741..22e59b23c7 100644 --- a/apps/explorer/lib/explorer/chain/token_transfer.ex +++ b/apps/explorer/lib/explorer/chain/token_transfer.ex @@ -114,7 +114,7 @@ defmodule Explorer.Chain.TokenTransfer do timestamps() end - @required_attrs ~w(block_number log_index from_address_hash to_address_hash token_contract_address_hash transaction_hash)a + @required_attrs ~w(block_number log_index from_address_hash to_address_hash token_contract_address_hash transaction_hash block_hash)a @optional_attrs ~w(amount token_id)a @doc false