From d241a443f61a006df27f9837d520b4671280b83d Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Thu, 2 May 2024 10:59:50 -0700 Subject: [PATCH 1/2] log tx during simulation and sending --- src/ethereum/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ethereum/mod.rs b/src/ethereum/mod.rs index 142a948b..06c41771 100644 --- a/src/ethereum/mod.rs +++ b/src/ethereum/mod.rs @@ -19,10 +19,10 @@ mod write_provider; #[derive(Clone, Debug)] pub struct Ethereum { - read_provider: Arc, + read_provider: Arc, // Mapping of chain id to provider secondary_read_providers: HashMap>, - write_provider: Arc, + write_provider: Arc, } impl Ethereum { @@ -72,11 +72,13 @@ impl Ethereum { tx: TypedTransaction, only_once: bool, ) -> Result { + tracing::info!(?tx, "Simulating transaction"); if let Err(err) = self.read_provider.call(&tx, None).await { tracing::error!("Error simulating transaction: {:?}", err); return Err(TxError::Simulate(anyhow::Error::new(err))); } + tracing::info!(?tx, "Sending transaction"); self.write_provider.send_transaction(tx, only_once).await } From 7680f6bed31cd96a6a64261790a98175a572c12c Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Thu, 2 May 2024 11:05:29 -0700 Subject: [PATCH 2/2] fmt --- src/ethereum/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ethereum/mod.rs b/src/ethereum/mod.rs index 06c41771..e93bbb8f 100644 --- a/src/ethereum/mod.rs +++ b/src/ethereum/mod.rs @@ -19,10 +19,10 @@ mod write_provider; #[derive(Clone, Debug)] pub struct Ethereum { - read_provider: Arc, + read_provider: Arc, // Mapping of chain id to provider secondary_read_providers: HashMap>, - write_provider: Arc, + write_provider: Arc, } impl Ethereum {