Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
add missing filter for tx receipts (#364)
Browse files Browse the repository at this point in the history
Co-authored-by: Santiago Pittella <[email protected]>
  • Loading branch information
SantiagoPittella and Santiago Pittella authored Nov 10, 2023
1 parent 3a09e6e commit b4331aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/starknet_explorer/data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ defmodule StarknetExplorer.Data do
end

def transaction(tx_hash, network) do
case Transaction.get_by_hash_with_receipt(tx_hash) do
case Transaction.get_by_hash_with_receipt(tx_hash, network) do
nil ->
with {:ok, %{"transaction_hash" => _transaction} = tx} <-
Rpc.get_transaction(tx_hash, network),
Expand Down
4 changes: 2 additions & 2 deletions lib/starknet_explorer/transaction.ex
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ defmodule StarknetExplorer.Transaction do
|> Repo.paginate(params)
end

def get_by_hash_with_receipt(hash) do
def get_by_hash_with_receipt(hash, network) do
query =
from tx in Transaction,
where: tx.hash == ^hash
where: tx.hash == ^hash and tx.network == ^network

case Repo.one(query) do
nil ->
Expand Down

0 comments on commit b4331aa

Please sign in to comment.