Skip to content

Commit

Permalink
chore(bin): import cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Nov 10, 2023
1 parent 8314673 commit ffbeadc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
3 changes: 1 addition & 2 deletions bin/mev/src/cmd/boost.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::cmd::config::Config;
use clap::Args;
use mev_boost_rs::Service;
use tracing::info;

#[derive(Debug, Args)]
#[clap(about = "🚀 connecting proposers to the external builder network")]
Expand All @@ -17,7 +16,7 @@ impl Command {
let config = Config::from_toml_file(config_file)?;

let network = config.network;
info!("configured for `{network}`");
tracing::info!("configured for `{network}`");

if let Some(config) = config.boost {
Ok(Service::from(network, config).spawn()?.await?)
Expand Down
11 changes: 5 additions & 6 deletions bin/mev/src/cmd/config.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
use clap::Args;
use ethereum_consensus::networks::Network;
use eyre::WrapErr;
use serde::Deserialize;
use std::{fmt, path::Path};

#[cfg(feature = "boost")]
use mev_boost_rs::Config as BoostConfig;
#[cfg(feature = "build")]
use mev_build_rs::reth_builder::Config as BuildConfig;
#[cfg(feature = "relay")]
use mev_relay_rs::Config as RelayConfig;
use mev_rs::config::from_toml_file;
use serde::Deserialize;
use std::{fmt, path::Path};
use tracing::info;

#[derive(Debug, Deserialize)]
pub struct Config {
Expand All @@ -28,7 +27,7 @@ impl Config {
pub fn from_toml_file<P: AsRef<Path> + fmt::Display>(path: P) -> eyre::Result<Config> {
tracing::info!("loading config from `{path}`...");

from_toml_file::<_, Self>(path.as_ref()).wrap_err("could not parse TOML")
mev_rs::config::from_toml_file::<_, Self>(path.as_ref()).wrap_err("could not parse TOML")
}
}

Expand All @@ -44,7 +43,7 @@ impl Command {
let config_file = self.config_file;

let config = Config::from_toml_file(config_file)?;
info!("{config:#?}");
tracing::info!("{config:#?}");

Ok(())
}
Expand Down
3 changes: 2 additions & 1 deletion bin/mev/src/cmd/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
pub mod config;

#[cfg(feature = "boost")]
pub mod boost;
#[cfg(feature = "build")]
pub mod build;
pub mod config;
#[cfg(feature = "relay")]
pub mod relay;
3 changes: 1 addition & 2 deletions bin/mev/src/cmd/relay.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::cmd::config::Config;
use clap::{Args, Subcommand};
use mev_relay_rs::Service;
use tracing::info;

#[derive(Debug, Args)]
#[clap(about = "🏗 connecting builders to proposers", subcommand_negates_reqs = true)]
Expand Down Expand Up @@ -31,7 +30,7 @@ impl Command {
let config = Config::from_toml_file(config_file)?;

let network = config.network;
info!("configured for `{network}`");
tracing::info!("configured for `{network}`");

if let Some(config) = config.relay {
let service = Service::from(network, config).spawn().await?;
Expand Down
4 changes: 2 additions & 2 deletions bin/mev/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
mod cmd;

use clap::{Parser, Subcommand};
use std::future::Future;
use tokio::signal;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};

mod cmd;

#[derive(Debug, Parser)]
#[clap(author, version, about = "utilities for block space", long_about = None)]
struct Cli {
Expand Down

0 comments on commit ffbeadc

Please sign in to comment.