Skip to content

Commit

Permalink
chore: deps + consts (#9)
Browse files Browse the repository at this point in the history
* bump deps + get rid of minor versions pin

* cleanup
  • Loading branch information
0xDmtri authored Sep 19, 2024
1 parent 7407d70 commit 52e2b9f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 19 deletions.
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 }
Expand All @@ -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"]
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
2 changes: 1 addition & 1 deletion examples/send_to_builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions src/eth/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ where
T: Transport + Clone,
N: Network,
{
///
/// Creates a new [`EthBundle`]
pub fn new(provider: &'a P) -> Self {
Self {
provider,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/eth/provider_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ where
async fn encode_request(&self, tx: N::TransactionRequest) -> TransportResult<Bytes>;

/// Returns a builder-style [`MevShareBundle`] that can be sent or simulated.
fn build_bundle<'a>(&'a self) -> EthBundle<'a, Self, Http<C>, N>;
fn build_bundle(&self) -> EthBundle<'_, Self, Http<C>, N>;

/// Submits a bundle to one or more builder(s). It takes in a bundle and
/// provides a bundle hash as a return value.
Expand Down
2 changes: 1 addition & 1 deletion src/eth/reqwest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ where
}
}

fn build_bundle<'a>(&'a self) -> EthBundle<'a, Self, Http<reqwest::Client>, N> {
fn build_bundle(&self) -> EthBundle<'_, Self, Http<reqwest::Client>, N> {
EthBundle::new(self)
}

Expand Down
2 changes: 1 addition & 1 deletion src/mev_share/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u64>) -> Self {
pub const fn with_inclusion(mut self, block: u64, max_block: Option<u64>) -> Self {
self.bundle.inclusion.block = block;
self.bundle.inclusion.max_block = max_block;

Expand Down
2 changes: 1 addition & 1 deletion src/mev_share/provider_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ where
) -> TransportResult<BundleItem>;

/// 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<S>(&self, bundle_signer: S) -> MevShareBundle<'_, Self, C, N, S>
where
S: Signer + Send + Sync + 'static;

Expand Down
5 changes: 1 addition & 4 deletions src/mev_share/reqwest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<S>(&self, bundle_signer: S) -> MevShareBundle<'_, Self, reqwest::Client, N, S>
where
S: Signer + Send + Sync + 'static,
{
Expand Down

0 comments on commit 52e2b9f

Please sign in to comment.