diff --git a/Cargo.toml b/Cargo.toml index d2ee69c..8a234e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ default = ["reqwest"] reqwest = ["dep:reqwest", "dep:serde_json", "dep:tower"] [dependencies] -alloy = { version = "0.3.0", features = [ +alloy = { version = "0.3", features = [ "rpc", "rpc-client", "rpc-types-mev", @@ -28,10 +28,10 @@ alloy = { version = "0.3.0", features = [ "transport-http", "signers", ] } -hyper = { version = "1.1", features = ["client"], optional = true } -tower = { version = "0.4", optional = true } +hyper = { version = "1.4", features = ["client"], optional = true } +tower = { version = "0.5", optional = true } futures = "0.3" -pin-project = "1.1.5" +pin-project = "1.1" reqwest = { version = "0.12", optional = true } url = "2.5" serde_json = { version ="1.0", optional = true } @@ -41,11 +41,11 @@ async-trait = "0.1" dotenv = "0.15" tokio = { version = "1", features = ["rt-multi-thread", "macros"] } anyhow = "1.0" -alloy = { version = "0.3.0", features = [ +alloy = { version = "0.3", features = [ "rpc-client", "consensus", "signer-local", ] } [package.metadata.docs.rs] -cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] \ No newline at end of file +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/examples/send_to_builders.rs b/examples/send_to_builders.rs index 8662b11..52cacf3 100644 --- a/examples/send_to_builders.rs +++ b/examples/send_to_builders.rs @@ -30,7 +30,7 @@ async fn main() -> Result<()> { .titan(BundleSigner::flashbots(bundle_signer.clone())) .build(); - let block_number: u64 = provider.get_block_number().await?.into(); + let block_number: u64 = provider.get_block_number().await?; // Pay Vitalik using a MEV-Share bundle! let tx = TransactionRequest::default() diff --git a/src/eth/bundle.rs b/src/eth/bundle.rs index 82c359d..dfa5c16 100644 --- a/src/eth/bundle.rs +++ b/src/eth/bundle.rs @@ -29,7 +29,7 @@ where T: Transport + Clone, N: Network, { - /// + /// Creates a new [`EthBundle`] pub fn new(provider: &'a P) -> Self { Self { provider, @@ -53,21 +53,21 @@ where } /// Sets the block number for which this bundle is valid. - pub fn on_block(mut self, block: u64) -> Self { + pub const fn on_block(mut self, block: u64) -> Self { self.bundle.block_number = block; self } /// Sets the unix timestamp when this bundle becomes active. - pub fn with_min_timestamp(mut self, min_timestamp: u64) -> Self { + pub const fn with_min_timestamp(mut self, min_timestamp: u64) -> Self { self.bundle.min_timestamp = Some(min_timestamp); self } /// Sets the unix timestamp how long this bundle stays valid. - pub fn with_max_timestamp(mut self, max_timestamp: u64) -> Self { + pub const fn with_max_timestamp(mut self, max_timestamp: u64) -> Self { self.bundle.max_timestamp = Some(max_timestamp); self diff --git a/src/eth/provider_ext.rs b/src/eth/provider_ext.rs index 1f38abf..6ab59d4 100644 --- a/src/eth/provider_ext.rs +++ b/src/eth/provider_ext.rs @@ -30,7 +30,7 @@ where async fn encode_request(&self, tx: N::TransactionRequest) -> TransportResult; /// Returns a builder-style [`MevShareBundle`] that can be sent or simulated. - fn build_bundle<'a>(&'a self) -> EthBundle<'a, Self, Http, N>; + fn build_bundle(&self) -> EthBundle<'_, Self, Http, N>; /// Submits a bundle to one or more builder(s). It takes in a bundle and /// provides a bundle hash as a return value. diff --git a/src/eth/reqwest.rs b/src/eth/reqwest.rs index 584d516..771323b 100644 --- a/src/eth/reqwest.rs +++ b/src/eth/reqwest.rs @@ -41,7 +41,7 @@ where } } - fn build_bundle<'a>(&'a self) -> EthBundle<'a, Self, Http, N> { + fn build_bundle(&self) -> EthBundle<'_, Self, Http, N> { EthBundle::new(self) } diff --git a/src/mev_share/bundle.rs b/src/mev_share/bundle.rs index ed906d4..5bc3478 100644 --- a/src/mev_share/bundle.rs +++ b/src/mev_share/bundle.rs @@ -72,7 +72,7 @@ where } /// Adds the data used by block builders to check if the bundle should be considered for inclusion. - pub fn with_inclusion(mut self, block: u64, max_block: Option) -> Self { + pub const fn with_inclusion(mut self, block: u64, max_block: Option) -> Self { self.bundle.inclusion.block = block; self.bundle.inclusion.max_block = max_block; diff --git a/src/mev_share/provider_ext.rs b/src/mev_share/provider_ext.rs index 5033f18..26b1972 100644 --- a/src/mev_share/provider_ext.rs +++ b/src/mev_share/provider_ext.rs @@ -27,7 +27,7 @@ where ) -> TransportResult; /// Returns a builder-style [`MevShareBundle`] that can be sent or simulated. - fn build_bundle<'a, S>(&'a self, bundle_signer: S) -> MevShareBundle<'a, Self, C, N, S> + fn build_bundle(&self, bundle_signer: S) -> MevShareBundle<'_, Self, C, N, S> where S: Signer + Send + Sync + 'static; diff --git a/src/mev_share/reqwest.rs b/src/mev_share/reqwest.rs index 77c0b55..d525ce0 100644 --- a/src/mev_share/reqwest.rs +++ b/src/mev_share/reqwest.rs @@ -51,10 +51,7 @@ where } } - fn build_bundle<'a, S>( - &'a self, - bundle_signer: S, - ) -> MevShareBundle<'a, Self, reqwest::Client, N, S> + fn build_bundle(&self, bundle_signer: S) -> MevShareBundle<'_, Self, reqwest::Client, N, S> where S: Signer + Send + Sync + 'static, {