Skip to content

Commit 6bda57a

Browse files
committed
chore: simplify signer dependency and documentate http features configuration
1 parent 4b3612a commit 6bda57a

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
11
# Mithril-aggregator-client [![CI workflow](https://github.com/input-output-hk/mithril/actions/workflows/ci.yml/badge.svg)](https://github.com/input-output-hk/mithril/actions/workflows/ci.yml) [![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://github.com/input-output-hk/mithril/blob/main/LICENSE) [![Discord](https://img.shields.io/discord/500028886025895936.svg?logo=discord&style=flat-square)](https://discord.gg/5kaErDKDRq)
22

3-
This crate provides a client to request data from a Mithril Aggregator.
3+
This crate provides a client to request data from a Mithril Aggregator over http.
4+
5+
## Configuration of http features
6+
7+
Reqwest is used as the backend for the http client. Its default features are disabled to let the user control
8+
which [features to enable](https://docs.rs/reqwest/latest/reqwest/#optional-features).
9+
10+
To enable a reqwest feature, add the following to your `Cargo.toml`:
11+
12+
```toml
13+
reqwest = { version = "x.yy", features = ["feature_a", "feature_b"] }
14+
```
15+
16+
for example, if reqwest is a workspace dependency, and you want to enable the `default` feature and the compression features:
17+
18+
```toml
19+
reqwest = { workspace = true, features = [
20+
"default",
21+
"gzip",
22+
"zstd",
23+
"deflate",
24+
"brotli"
25+
] }
26+
```
27+
28+
### Unused dependency warning
29+
30+
You should add the `reqwest` dependency even if you don't use it directly in your code.
31+
If you are using [`cargo machete`](https://github.com/bnjbvr/cargo-machete) to track unused dependencies, it will raise a warning.
32+
33+
To avoid this warning, add the following to your `Cargo.toml`:
34+
35+
```toml
36+
[package.metadata.cargo-machete]
37+
# reqwest: for features configuration, indirect dependency via `mithril-aggregator-client`
38+
ignored = ["reqwest"]
39+
```

mithril-signer/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ homepage = { workspace = true }
99
license = { workspace = true }
1010
repository = { workspace = true }
1111

12+
[package.metadata.cargo-machete]
13+
# reqwest: for features configuration, indirect dependency via `mithril-aggregator-client`
14+
ignored = ["reqwest"]
15+
1216
[features]
1317
default = ["jemallocator"]
1418

@@ -46,7 +50,6 @@ reqwest = { workspace = true, features = [
4650
"deflate",
4751
"brotli"
4852
] }
49-
semver = { workspace = true }
5053
serde = { workspace = true }
5154
serde_json = { workspace = true }
5255
slog = { workspace = true, features = [
@@ -64,7 +67,6 @@ tikv-jemallocator = { version = "0.6.0", optional = true }
6467

6568
[dev-dependencies]
6669
criterion = { version = "0.7.0", features = ["html_reports", "async_tokio"] }
67-
http = "1.3.1"
6870
httpmock = "0.8.1"
6971
mockall = { workspace = true }
7072
prometheus-parse = "0.2.5"

0 commit comments

Comments
 (0)