Skip to content

Commit

Permalink
Merge pull request #111 from ralexstokes/fix-secret-key-debug
Browse files Browse the repository at this point in the history
derive upstream `Debug` in lieu of local impl
  • Loading branch information
ralexstokes authored Jul 31, 2023
2 parents a1f271c + 9c1436a commit e42adc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 29 deletions.
17 changes: 2 additions & 15 deletions mev-build-rs/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use mev_rs::{
Error, Network,
};
use serde::Deserialize;
use std::{fmt, future::Future, net::Ipv4Addr, pin::Pin, sync::Arc, task::Poll};
use std::{future::Future, net::Ipv4Addr, pin::Pin, sync::Arc, task::Poll};
use tokio::{
sync::mpsc,
task::{JoinError, JoinHandle},
Expand All @@ -22,7 +22,7 @@ use url::Url;

const BUILD_JOB_BUFFER_SIZE: usize = 1;

#[derive(Deserialize)]
#[derive(Deserialize, Debug)]
pub struct Config {
pub host: Ipv4Addr,
pub port: u16,
Expand All @@ -33,19 +33,6 @@ pub struct Config {
pub secret_key: SecretKey,
}

impl fmt::Debug for Config {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Config")
.field("host", &self.host)
.field("port", &self.port)
.field("beacon_api_endpoint", &self.beacon_api_endpoint)
.field("network", &self.network)
.field("engine_api_proxy", &self.engine_api_proxy)
.field("secret_key", &"...")
.finish()
}
}

impl Default for Config {
fn default() -> Self {
Self {
Expand Down
16 changes: 2 additions & 14 deletions mev-relay-rs/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use ethereum_consensus::{crypto::SecretKey, state_transition::Context};
use futures::StreamExt;
use mev_rs::{blinded_block_provider::Server as BlindedBlockProviderServer, Error, Network};
use serde::Deserialize;
use std::{fmt, future::Future, net::Ipv4Addr, pin::Pin, sync::Arc, task::Poll};
use std::{future::Future, net::Ipv4Addr, pin::Pin, sync::Arc, task::Poll};
use tokio::task::{JoinError, JoinHandle};
use url::Url;

#[derive(Deserialize)]
#[derive(Deserialize, Debug)]
pub struct Config {
pub host: Ipv4Addr,
pub port: u16,
Expand All @@ -18,18 +18,6 @@ pub struct Config {
pub secret_key: SecretKey,
}

impl fmt::Debug for Config {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Config")
.field("host", &self.host)
.field("port", &self.port)
.field("beacon_node_url", &self.beacon_node_url)
.field("network", &self.network)
.field("secret_key", &"...")
.finish()
}
}

impl Default for Config {
fn default() -> Self {
Self {
Expand Down

0 comments on commit e42adc3

Please sign in to comment.