Skip to content

Commit 0f94007

Browse files
committed
fix: search for batches
1 parent 80f2ce8 commit 0f94007

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • explorer/lib/explorer_web/components

explorer/lib/explorer_web/components/search.ex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ defmodule SearchComponent do
1111
|> case do
1212
{:ok, hash} ->
1313
cond do
14-
# See if the hash belongs to a proof
14+
# See if the hash belongs to a proof in a batch
15+
# If so, redirect to search to show all the batches where this proofs exists
1516
Proofs.get_number_of_batches_containing_proof(hash) > 0 ->
17+
{:noreply, push_navigate(socket, to: ~p"/search?q=#{hash}")}
18+
19+
# See if the hash belongs to the root of a batch
20+
Batches.get_batch(%{merkle_root: hash}) != nil ->
1621
{:noreply, push_navigate(socket, to: ~p"/batches/#{hash}")}
1722

1823
# See if the hash belongs to an aggregated proof merkle root
1924
(proof = AggregatedProofs.get_newest_aggregated_proof_by_merkle_root(hash)) != nil ->
20-
Logger.debug(proof)
2125
{:noreply, push_navigate(socket, to: ~p"/aggregated_proofs/#{proof.id}")}
2226

2327
# Finally, see if the hash belongs to a proof of an aggregated proof

0 commit comments

Comments
 (0)