Skip to content

Commit

Permalink
chore: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-savu committed Dec 29, 2024
1 parent 1d4177f commit a8c9662
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 40 deletions.
101 changes: 67 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ethers-middleware/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ futures-util = { version = "^0.3" }
futures-locks = { version = "0.7", default-features = false }
tracing = { version = "0.1.37", default-features = false }
tracing-futures = { version = "0.2.5", default-features = false }
tracing-test = "0.2.2"

# for gas oracles
reqwest = { version = "0.11.13", default-features = false, features = ["json", "rustls-tls"] }
Expand Down
4 changes: 3 additions & 1 deletion ethers-middleware/src/gas_oracle/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use async_trait::async_trait;
use ethers_core::types::{transaction::eip2718::TypedTransaction, *};
use ethers_providers::{FromErr, Middleware, PendingTransaction};
use thiserror::Error;
use tracing::instrument;

#[derive(Debug)]
/// Middleware used for fetching gas prices over an API instead of `eth_gasPrice`
Expand Down Expand Up @@ -102,13 +103,14 @@ where
Ok(self.gas_oracle.estimate_eip1559_fees().await?)
}

#[instrument(skip(self), name = "GasOracle::send_transaction")]
#[instrument(skip(self, tx), name = "GasOracle::send_transaction")]
async fn send_transaction<T: Into<TypedTransaction> + Send + Sync>(
&self,
tx: T,
block: Option<BlockId>,
) -> Result<PendingTransaction<'_, Self::Provider>, Self::Error> {
let mut tx = tx.into();
tracing::debug!(?tx, "Sending transaction");
self.fill_transaction(&mut tx, block).await?;
self.inner.send_transaction(tx, block).await.map_err(MiddlewareError::MiddlewareError)
}
Expand Down
Loading

0 comments on commit a8c9662

Please sign in to comment.