Skip to content

Commit

Permalink
Merge pull request #1490 from input-output-hk/djo/1474/upgrade_http_c…
Browse files Browse the repository at this point in the history
…rate

Remove `http` from dependencies, use `warp` re-exported types instead
  • Loading branch information
Alenar authored Feb 8, 2024
2 parents 9767354 + 9fc48a1 commit 0173db4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
7 changes: 3 additions & 4 deletions Cargo.lock

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

5 changes: 2 additions & 3 deletions mithril-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-common"
version = "0.2.160"
version = "0.2.161"
description = "Common types, interfaces, and utilities for Mithril nodes."
authors = { workspace = true }
edition = { workspace = true }
Expand Down 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
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions mithril-test-lab/mithril-aggregator-fake/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-aggregator-fake"
version = "0.1.2"
version = "0.1.3"
description = "Mithril Fake Aggregator for client testing"
authors = { workspace = true }
documentation = { workspace = true }
Expand All @@ -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
Original file line number Diff line number Diff line change
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 0173db4

Please sign in to comment.