diff --git a/translator/src/tasks/ship_reader.rs b/translator/src/tasks/ship_reader.rs index 6441ea4..db3a13e 100644 --- a/translator/src/tasks/ship_reader.rs +++ b/translator/src/tasks/ship_reader.rs @@ -4,8 +4,8 @@ use futures_util::StreamExt; use tokio::net::TcpStream; use tokio::sync::mpsc; use tokio_tungstenite::{MaybeTlsStream, WebSocketStream}; -use tracing::debug; use tracing::info; +use tracing::{debug, error}; pub async fn ship_reader( mut ws_rx: SplitStream>>, @@ -26,14 +26,14 @@ pub async fn ship_reader( Some(Ok(msg)) => { debug!("Received message {counter}, sending to raw ds pool...",); // write to the channel - if raw_ds_tx.send(msg.into_data()).await.is_err() { - println!("Receiver dropped"); + if let Err(e) = raw_ds_tx.send(msg.into_data()).await { + error!("Receiver dropped {:?}", e); break; } debug!("Sent message {counter} to raw ds pool..."); } Some(Err(e)) => { - println!("Error receiving message: {}", e); + error!("Error receiving message: {}", e); break; } None => { diff --git a/translator/src/types/evm_types.rs b/translator/src/types/evm_types.rs index 5609c9a..f68244c 100644 --- a/translator/src/types/evm_types.rs +++ b/translator/src/types/evm_types.rs @@ -11,6 +11,7 @@ use antelope::serializer::Encoder; use antelope::util::hex_to_bytes; use antelope::StructPacker; use serde::{Deserialize, Deserializer, Serialize}; +use tracing::warn; #[derive(Debug, Clone, Default, Serialize, Deserialize, StructPacker)] pub struct RawAction { @@ -175,11 +176,11 @@ impl PrintedReceipt { let printed_receipt = serde_json::from_str::(extracted).unwrap(); Some(printed_receipt) } else { - println!("End pattern not found."); + warn!("End pattern not found."); None } } else { - println!("Start pattern not found."); + warn!("Start pattern not found."); None } } diff --git a/translator/src/types/translator_types.rs b/translator/src/types/translator_types.rs index a87db3d..9daa6f1 100644 --- a/translator/src/types/translator_types.rs +++ b/translator/src/types/translator_types.rs @@ -104,6 +104,7 @@ impl NameToAddressCache { let address = Address::from(account_row.address.data); self.cache.insert(index, address); self.index_cache.insert(account_row.index, address); + return Ok(address); } else { warn!("Got empty rows for index {index}, retry attempt {i}");