diff --git a/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex index 311c41ec2f..a478c791de 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex @@ -43,7 +43,7 @@ <%= link( gettext( "Block #%{number}", - number: @transfer.transaction.block_number + number: @transfer.block_number ), class: "mr-2 mr-sm-0 text-muted", to: block_path(BlockScoutWeb.Endpoint, :show, @transfer.transaction.block_number) diff --git a/apps/explorer/lib/explorer/chain/token_transfer.ex b/apps/explorer/lib/explorer/chain/token_transfer.ex index f68e4baf38..a539dfa7e0 100644 --- a/apps/explorer/lib/explorer/chain/token_transfer.ex +++ b/apps/explorer/lib/explorer/chain/token_transfer.ex @@ -26,7 +26,7 @@ defmodule Explorer.Chain.TokenTransfer do import Ecto.{Changeset, Query} - alias Explorer.Chain.{Address, Block, Hash, Token, TokenTransfer, Transaction} + alias Explorer.Chain.{Address, Hash, Token, TokenTransfer, Transaction} alias Explorer.{PagingOptions, Repo} @default_paging_options %PagingOptions{page_size: 50} @@ -121,13 +121,9 @@ defmodule Explorer.Chain.TokenTransfer do query = from( tt in TokenTransfer, - join: t in Transaction, - on: tt.transaction_hash == t.hash, - join: b in Block, - on: t.block_hash == b.hash, where: tt.token_contract_address_hash == ^token_address_hash, preload: [{:transaction, :block}, :token, :from_address, :to_address], - order_by: [desc: b.timestamp] + order_by: [desc: tt.block_number] ) query