Skip to content

Commit

Permalink
Remove http from dependencies
Browse files Browse the repository at this point in the history
Since it's already re-exported by warp, our main current solution for
http server.
  • Loading branch information
Alenar committed Feb 6, 2024
1 parent 794aa57 commit 5ad46c1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions mithril-common/Cargo.toml
Expand Up @@ -28,7 +28,6 @@ ed25519-dalek = { version = "2.1.0", features = ["rand_core", "serde"] }
fixed = "1.24.0"
glob = { version = "0.3.1", optional = true }
hex = "0.4.3"
http = { version = "0.2.9", optional = true }
jsonschema = { version = "0.17.1", optional = true }
kes-summed-ed25519 = { version = "0.2.1", features = [
"serde_enabled",
Expand Down Expand Up @@ -107,7 +106,7 @@ allow_skip_signer_certification = []
# Enable all tests tools
test_tools = ["apispec", "test_http_server", "random"]
# Enable tools to helps validate conformity to an OpenAPI specification
apispec = ["dep:glob", "dep:http", "dep:jsonschema", "dep:warp"]
apispec = ["dep:glob", "dep:jsonschema", "dep:warp"]
test_http_server = ["dep:warp"]

[package.metadata.docs.rs]
Expand Down
4 changes: 2 additions & 2 deletions mithril-common/src/test_utils/apispec.rs
@@ -1,10 +1,10 @@
//! Tools to helps validate conformity to an OpenAPI specification

use glob::glob;
use http::response::Response;
use jsonschema::JSONSchema;
use serde::Serialize;
use serde_json::{json, Value, Value::Null};
use warp::http::Response;
use warp::hyper::body::Bytes;

use crate::era::SupportedEra;
Expand Down Expand Up @@ -190,8 +190,8 @@ impl<'a> APISpec<'a> {

#[cfg(test)]
mod tests {
use http::StatusCode;
use warp::http::Method;
use warp::http::StatusCode;

use super::*;
use crate::entities;
Expand Down
3 changes: 2 additions & 1 deletion mithril-test-lab/mithril-aggregator-fake/Cargo.toml
Expand Up @@ -24,9 +24,10 @@ tracing = "0.1.40"
tracing-subscriber = "0.3.18"

[dev-dependencies]
http = "0.2.9"
mithril-common = { "path" = "../../mithril-common", features = [
"test_tools",
"random",
] }
reqwest = "0.11.23"
warp = "0.3.6"

16 changes: 8 additions & 8 deletions mithril-test-lab/mithril-aggregator-fake/src/application.rs
Expand Up @@ -89,13 +89,13 @@ impl Application {

#[cfg(test)]
mod tests {
use http::StatusCode;
use serde_json::Value::Null;
use std::time::Duration;
use tokio::{
task::{yield_now, JoinHandle},
time::sleep,
};
use warp::http::{Response, StatusCode};

use mithril_common::test_utils::apispec::APISpec;

Expand Down Expand Up @@ -144,7 +144,7 @@ mod tests {
path,
"application/json",
&Null,
&http::Response::new(response.bytes().await.unwrap()),
&Response::new(response.bytes().await.unwrap()),
);

Ok(())
Expand Down Expand Up @@ -173,7 +173,7 @@ mod tests {
path,
"application/json",
&Null,
&http::Response::new(response.bytes().await.unwrap()),
&Response::new(response.bytes().await.unwrap()),
);

Ok(())
Expand Down Expand Up @@ -202,7 +202,7 @@ mod tests {
path,
"application/json",
&Null,
&http::Response::new(response.bytes().await.unwrap()),
&Response::new(response.bytes().await.unwrap()),
);

Ok(())
Expand Down Expand Up @@ -238,7 +238,7 @@ mod tests {
path,
"application/json",
&Null,
&http::Response::new(response.bytes().await.unwrap()),
&Response::new(response.bytes().await.unwrap()),
);

Ok(())
Expand Down Expand Up @@ -290,7 +290,7 @@ mod tests {
path,
"application/json",
&Null,
&http::Response::new(response.bytes().await.unwrap()),
&Response::new(response.bytes().await.unwrap()),
);

Ok(())
Expand Down Expand Up @@ -345,7 +345,7 @@ mod tests {
path,
"application/json",
&Null,
&http::Response::new(response.bytes().await.unwrap()),
&Response::new(response.bytes().await.unwrap()),
);

Ok(())
Expand Down Expand Up @@ -394,7 +394,7 @@ mod tests {
path,
"application/json",
&Null,
&http::Response::new(response.bytes().await.unwrap()),
&Response::new(response.bytes().await.unwrap()),
);

Ok(())
Expand Down

0 comments on commit 5ad46c1

Please sign in to comment.