From 0b4c90f2f614f82f7910fb6b2ce095ead8ec7dfa Mon Sep 17 00:00:00 2001
From: Patrice Tisserand
Date: Wed, 3 Apr 2024 11:43:48 +0200
Subject: [PATCH] indexer: avoid panic when ethereum event has only 1 topic
---
apps/indexer/src/ethereum_indexer/events.rs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/apps/indexer/src/ethereum_indexer/events.rs b/apps/indexer/src/ethereum_indexer/events.rs
index 72e283b3..b98a735f 100644
--- a/apps/indexer/src/ethereum_indexer/events.rs
+++ b/apps/indexer/src/ethereum_indexer/events.rs
@@ -39,6 +39,10 @@ const COLLECTION_DEPOYED_FROM_L2_SIG: &str =
/// Returns storage data from the log entry.
pub fn get_store_data(log: Log) -> Result<(Option, Option, Option)> {
+ if log.topics.len() < 2 {
+ log::debug!("not handled log\n{:?}\n", log);
+ return Ok((None, None, None));
+ }
let sig = format!("{:#64x}", log.topics[0]);
let req_hash = format!("{:#64x}", log.topics[1]);