From 92d9a5b017e6a4d87f3a7888878823bf07ed7705 Mon Sep 17 00:00:00 2001 From: dubzn Date: Fri, 19 Jan 2024 15:32:16 -0300 Subject: [PATCH] torii - Log events in debug!() as hex --- crates/torii/core/src/engine.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/torii/core/src/engine.rs b/crates/torii/core/src/engine.rs index 55e6a57114..4a4359ba2a 100644 --- a/crates/torii/core/src/engine.rs +++ b/crates/torii/core/src/engine.rs @@ -11,7 +11,7 @@ use starknet::providers::Provider; use tokio::sync::broadcast::Sender; use tokio::sync::mpsc::Sender as BoundedSender; use tokio::time::sleep; -use tracing::{error, info, warn}; +use tracing::{debug, error, info, warn}; use crate::processors::{BlockProcessor, EventProcessor, TransactionProcessor}; use crate::sql::Sql; @@ -253,6 +253,10 @@ impl<'db, P: Provider + Sync> Engine<'db, P> { processor .process(&self.world, self.db, block, invoke_receipt, event_id, event) .await?; + } else { + let keys: Vec = event.keys.iter().map(|k| format!("{:#x}", k)).collect(); + let data: Vec = event.data.iter().map(|d| format!("{:#x}", d)).collect(); + debug!("Event {{ keys: {:?}, data: {:?} }}", keys, data); } } Ok(())