diff --git a/evmlib/src/cryptography.rs b/evmlib/src/cryptography.rs index 02870942d9..b18d729f3c 100644 --- a/evmlib/src/cryptography.rs +++ b/evmlib/src/cryptography.rs @@ -37,6 +37,7 @@ 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 with evm scret key successfully"); Ok(signature.to_vec()) } diff --git a/evmlib/src/external_signer.rs b/evmlib/src/external_signer.rs index 20c3aa95df..5366c4e55d 100644 --- a/evmlib/src/external_signer.rs +++ b/evmlib/src/external_signer.rs @@ -33,7 +33,9 @@ pub fn approve_to_spend_tokens_calldata( ) -> (Calldata, Address) { let provider = http_provider(network.rpc_url().clone()); let network_token = NetworkToken::new(*network.payment_token_address(), provider); - network_token.approve_calldata(spender, value) + let ret_value = network_token.approve_calldata(spender, value); + debug!("spend tokens calldata is approved"); + ret_value } /// Transfer payment tokens from the supplied wallet to an address. @@ -87,10 +89,12 @@ pub fn pay_for_quotes_calldata>( calldata_map.insert(calldata, quote_hashes); } - Ok(PayForQuotesCalldataReturnType { + let return_value = Ok(PayForQuotesCalldataReturnType { batched_calldata_map: calldata_map, to: *data_payments.contract.address(), approve_spender, approve_amount, - }) + }); + debug!("pay for quotes calldata is approved"); + return_value } diff --git a/evmlib/src/testnet.rs b/evmlib/src/testnet.rs index e5f1f79708..57a9a12c4b 100644 --- a/evmlib/src/testnet.rs +++ b/evmlib/src/testnet.rs @@ -20,6 +20,7 @@ use alloy::providers::fillers::{ use alloy::providers::{Identity, ProviderBuilder, ReqwestProvider}; use alloy::signers::local::PrivateKeySigner; use alloy::transports::http::{Client, Http}; +use serde::de; pub struct Testnet { anvil: AnvilInstance, @@ -37,7 +38,7 @@ impl Testnet { let data_payments = deploy_data_payments_contract(&rpc_url, &anvil, *network_token.contract.address()) .await; - + debug!("Instantiated a testnet"); Testnet { anvil, rpc_url, @@ -80,7 +81,7 @@ pub fn start_node() -> (AnvilInstance, Url) { .expect("Could not spawn Anvil node"); let url = Url::parse(&format!("http://{host}:{port}")).expect("Failed to parse URL"); - + debug!("Started Anvil node at {url}"); (anvil, url) } @@ -113,7 +114,10 @@ pub async fn deploy_network_token_contract( .on_http(rpc_url.clone()); // Deploy the contract. - NetworkToken::deploy(provider).await + let deployed = NetworkToken::deploy(provider).await; + let address = *deployed.contract.address(); + debug!("Deployed network token contract at {address}"); + deployed } pub async fn deploy_data_payments_contract( @@ -146,5 +150,8 @@ pub async fn deploy_data_payments_contract( .on_http(rpc_url.clone()); // Deploy the contract. - DataPaymentsHandler::deploy(provider, token_address).await + let deployed = DataPaymentsHandler::deploy(provider, token_address).await; + let address = *deployed.contract.address(); + debug!("Deployed data payments contract at {address}"); + deployed } diff --git a/evmlib/src/transaction.rs b/evmlib/src/transaction.rs index dc8609a4d5..59ba04a8a3 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) } @@ -57,6 +58,7 @@ async fn get_block_by_number(network: &Network, block_number: u64) -> Result Result