From e7877ebdad867dc678be2407a9d363b502a5607f Mon Sep 17 00:00:00 2001 From: Ermine Jose Date: Thu, 5 Dec 2024 21:30:55 +0530 Subject: [PATCH] feat: add debug prints to evmlib --- evmlib/src/contract/data_payments/mod.rs | 2 ++ evmlib/src/cryptography.rs | 2 ++ evmlib/src/transaction.rs | 1 + 3 files changed, 5 insertions(+) diff --git a/evmlib/src/contract/data_payments/mod.rs b/evmlib/src/contract/data_payments/mod.rs index ce633fb269..69efbc6338 100644 --- a/evmlib/src/contract/data_payments/mod.rs +++ b/evmlib/src/contract/data_payments/mod.rs @@ -50,6 +50,7 @@ where let contract = DataPaymentsContract::deploy(provider, payment_token_address) .await .expect("Could not deploy contract"); + debug!("DataPayments contract deployed at: {:?}", contract.address()); DataPaymentsHandler { contract } } @@ -66,6 +67,7 @@ where data_payments: I, ) -> Result { let (calldata, to) = self.pay_for_quotes_calldata(data_payments)?; + debug!("Data payments calldata is processed to the address {:?}", to); let transaction_request = self .contract diff --git a/evmlib/src/cryptography.rs b/evmlib/src/cryptography.rs index 02870942d9..84ad2b31d3 100644 --- a/evmlib/src/cryptography.rs +++ b/evmlib/src/cryptography.rs @@ -37,6 +37,8 @@ pub fn sign_message(evm_secret_key_str: &str, message: &[u8]) -> Result, let message_hash = to_eth_signed_message_hash(message); let (signature, _) = sign_message_recoverable(&signer.into_credential(), message_hash)?; + debug!("Message signed successfully with {message_hash:?} and {signature:?}"); + Ok(signature.to_vec()) } diff --git a/evmlib/src/transaction.rs b/evmlib/src/transaction.rs index dc8609a4d5..7e09e4495f 100644 --- a/evmlib/src/transaction.rs +++ b/evmlib/src/transaction.rs @@ -45,6 +45,7 @@ pub async fn get_transaction_receipt_by_hash( .get_transaction_receipt(transaction_hash) .await .inspect_err(|err| error!("Error getting transaction receipt for transaction_hash: {transaction_hash:?} : {err:?}", ))?; + debug!("Transaction receipt for {transaction_hash:?}: {maybe_receipt:?}"); Ok(maybe_receipt) }