diff --git a/CHANGELOG.md b/CHANGELOG.md index c3f16d594e..4f9b01e515 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ - [#1960](https://github.com/poanetwork/blockscout/pull/1960) - do not remove bold text in decompiled contacts - [#1992](https://github.com/poanetwork/blockscout/pull/1992) - fix: support https for wobserver polling - [#1966](https://github.com/poanetwork/blockscout/pull/1966) - fix: add fields for contract filter performance +- [#2017](https://github.com/poanetwork/blockscout/pull/2017) - fix: fix to/from filters on tx list pages - [#2008](https://github.com/poanetwork/blockscout/pull/2008) - add new function clause for xDai network beneficiaries - [#2009](https://github.com/poanetwork/blockscout/pull/2009) - addresses page improvements diff --git a/apps/explorer/lib/explorer/chain/token_transfer.ex b/apps/explorer/lib/explorer/chain/token_transfer.ex index 6dd5a547d7..fa7ba99347 100644 --- a/apps/explorer/lib/explorer/chain/token_transfer.ex +++ b/apps/explorer/lib/explorer/chain/token_transfer.ex @@ -175,7 +175,7 @@ defmodule Explorer.Chain.TokenTransfer do from( tt in TokenTransfer, where: tt.to_address_hash == ^address_hash, - select: tt.transaction_hash + select: type(tt.transaction_hash, :binary) ) query @@ -189,7 +189,7 @@ defmodule Explorer.Chain.TokenTransfer do from( tt in TokenTransfer, where: tt.from_address_hash == ^address_hash, - select: tt.transaction_hash + select: type(tt.transaction_hash, :binary) ) query diff --git a/apps/explorer/test/explorer/chain/token_transfer_test.exs b/apps/explorer/test/explorer/chain/token_transfer_test.exs index 35741b78b9..5d9608e66b 100644 --- a/apps/explorer/test/explorer/chain/token_transfer_test.exs +++ b/apps/explorer/test/explorer/chain/token_transfer_test.exs @@ -247,9 +247,11 @@ defmodule Explorer.Chain.TokenTransferTest do amount: 1 ) + {:ok, transaction_bytes} = Explorer.Chain.Hash.Full.dump(transaction.hash) + transactions_hashes = TokenTransfer.where_any_address_fields_match(:to, paul.hash, %PagingOptions{page_size: 1}) - assert Enum.member?(transactions_hashes, transaction.hash) == true + assert Enum.member?(transactions_hashes, transaction_bytes) == true end test "when from_address_hash match returns transactions hashes list" do @@ -283,9 +285,11 @@ defmodule Explorer.Chain.TokenTransferTest do amount: 1 ) + {:ok, transaction_bytes} = Explorer.Chain.Hash.Full.dump(transaction.hash) + transactions_hashes = TokenTransfer.where_any_address_fields_match(:from, john.hash, %PagingOptions{page_size: 1}) - assert Enum.member?(transactions_hashes, transaction.hash) == true + assert Enum.member?(transactions_hashes, transaction_bytes) == true end test "when to_from_address_hash or from_address_hash match returns transactions hashes list" do