Skip to content

Commit

Permalink
chore: remove redundant crate dependency (#2195)
Browse files Browse the repository at this point in the history
commit-id:5054ab86
  • Loading branch information
Itay-Tsabary-Starkware authored Nov 26, 2024
1 parent 8c9634a commit a045ec8
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 17 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion crates/papyrus_monitoring_gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ tracing.workspace = true
validator = { workspace = true, features = ["derive"] }

[dev-dependencies]
http-body.workspace = true
metrics.workspace = true
papyrus_storage = { workspace = true, features = ["testing"] }
pretty_assertions.workspace = true
Expand Down
6 changes: 1 addition & 5 deletions crates/papyrus_monitoring_gateway/src/gateway_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use axum::body::Body;
use axum::http::{Request, StatusCode};
use axum::response::Response;
use axum::Router;
use http_body::combinators::UnsyncBoxBody;
use metrics::{absolute_counter, describe_counter, register_counter};
use metrics_exporter_prometheus::PrometheusBuilder;
use papyrus_storage::{table_names, test_utils};
Expand Down Expand Up @@ -38,10 +37,7 @@ fn setup_app() -> Router {
)
}

async fn request_app(
app: Router,
method: &str,
) -> Response<UnsyncBoxBody<axum::body::Bytes, axum::Error>> {
async fn request_app(app: Router, method: &str) -> Response {
app.oneshot(
Request::builder()
.uri(format!("/{MONITORING_PREFIX}/{method}").as_str())
Expand Down
4 changes: 1 addition & 3 deletions crates/starknet_monitoring_endpoint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ license-file.workspace = true
normal = ["tokio"]

[features]
testing = ["http-body", "tokio", "tower"]
testing = ["tokio", "tower"]

[lints]
workspace = true

[dependencies]
axum.workspace = true
http-body = { workspace = true, optional = true }
hyper = { workspace = true }
papyrus_config.workspace = true
serde.workspace = true
Expand All @@ -27,7 +26,6 @@ tracing.workspace = true
validator.workspace = true

[dev-dependencies]
http-body.workspace = true
pretty_assertions.workspace = true
tokio.workspace = true
tower.workspace = true
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::net::IpAddr;

use axum::body::Bytes;
use axum::http::StatusCode;
use axum::response::Response;
use axum::{Error, Router};
use http_body::combinators::UnsyncBoxBody;
use axum::Router;
use hyper::body::to_bytes;
use hyper::Client;
use pretty_assertions::assert_eq;
Expand All @@ -28,7 +26,7 @@ fn setup_monitoring_endpoint() -> MonitoringEndpoint {
create_monitoring_endpoint(MonitoringEndpointConfig::default(), TEST_VERSION)
}

async fn request_app(app: Router, method: &str) -> Response<UnsyncBoxBody<Bytes, Error>> {
async fn request_app(app: Router, method: &str) -> Response {
app.oneshot(build_request(&IpAddr::from([0, 0, 0, 0]), 0, method)).await.unwrap()
}

Expand Down
2 changes: 0 additions & 2 deletions crates/starknet_monitoring_endpoint/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ use tracing::info;

use crate::monitoring_endpoint::{ALIVE, MONITORING_PREFIX};

// TODO(Tsabary): try avoid having to use http-body crate from the dependencies.

/// Client for querying 'alive' status of an http server.
pub struct IsAliveClient {
socket: SocketAddr,
Expand Down

0 comments on commit a045ec8

Please sign in to comment.