mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-02 16:21:42 +00:00
Consolidate reqwest versions (#8452)
Update `reqwest` to 0.12 so we only depend on a single version. This should slightly improve compile times and reduce binary bloat. Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
226
Cargo.lock
generated
226
Cargo.lock
generated
@@ -382,7 +382,7 @@ dependencies = [
|
||||
"lru 0.13.0",
|
||||
"parking_lot",
|
||||
"pin-project",
|
||||
"reqwest 0.12.24",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 2.0.17",
|
||||
@@ -426,7 +426,7 @@ dependencies = [
|
||||
"alloy-transport-http",
|
||||
"futures",
|
||||
"pin-project",
|
||||
"reqwest 0.12.24",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tokio",
|
||||
@@ -612,7 +612,7 @@ checksum = "dc1b37b1a30d23deb3a8746e882c70b384c574d355bc2bbea9ea918b0c31366e"
|
||||
dependencies = [
|
||||
"alloy-json-rpc",
|
||||
"alloy-transport",
|
||||
"reqwest 0.12.24",
|
||||
"reqwest",
|
||||
"serde_json",
|
||||
"tower 0.5.2",
|
||||
"tracing",
|
||||
@@ -1150,7 +1150,7 @@ dependencies = [
|
||||
"pin-project-lite",
|
||||
"rustversion",
|
||||
"serde",
|
||||
"sync_wrapper 1.0.2",
|
||||
"sync_wrapper",
|
||||
"tower 0.5.2",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
@@ -1171,7 +1171,7 @@ dependencies = [
|
||||
"mime",
|
||||
"pin-project-lite",
|
||||
"rustversion",
|
||||
"sync_wrapper 1.0.2",
|
||||
"sync_wrapper",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
]
|
||||
@@ -1596,7 +1596,7 @@ dependencies = [
|
||||
"ethereum_ssz",
|
||||
"lighthouse_version",
|
||||
"mockito",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"sensitive_url",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -2549,7 +2549,7 @@ dependencies = [
|
||||
"alloy-primitives",
|
||||
"ethereum_ssz",
|
||||
"hex",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"serde_json",
|
||||
"sha2 0.9.9",
|
||||
"tree_hash",
|
||||
@@ -3152,7 +3152,7 @@ dependencies = [
|
||||
"pretty_reqwest_error",
|
||||
"proto_array",
|
||||
"rand 0.9.2",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"reqwest-eventsource",
|
||||
"sensitive_url",
|
||||
"serde",
|
||||
@@ -3229,7 +3229,7 @@ dependencies = [
|
||||
"ethereum_ssz",
|
||||
"kzg",
|
||||
"pretty_reqwest_error",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"sensitive_url",
|
||||
"serde_yaml",
|
||||
"sha2 0.9.9",
|
||||
@@ -3373,7 +3373,7 @@ dependencies = [
|
||||
"hex",
|
||||
"logging",
|
||||
"network_utils",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"sensitive_url",
|
||||
"serde_json",
|
||||
"task_executor",
|
||||
@@ -3411,7 +3411,7 @@ dependencies = [
|
||||
"parking_lot",
|
||||
"pretty_reqwest_error",
|
||||
"rand 0.9.2",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"sensitive_url",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -4292,7 +4292,7 @@ dependencies = [
|
||||
"malloc_utils",
|
||||
"metrics",
|
||||
"network_utils",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"slot_clock",
|
||||
"store",
|
||||
@@ -4370,16 +4370,19 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "hyper-rustls"
|
||||
version = "0.24.2"
|
||||
version = "0.27.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590"
|
||||
checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
|
||||
dependencies = [
|
||||
"futures-util",
|
||||
"http 0.2.12",
|
||||
"hyper 0.14.32",
|
||||
"rustls 0.21.12",
|
||||
"http 1.3.1",
|
||||
"hyper 1.8.1",
|
||||
"hyper-util",
|
||||
"rustls 0.23.35",
|
||||
"rustls-pki-types",
|
||||
"tokio",
|
||||
"tokio-rustls 0.24.1",
|
||||
"tokio-rustls 0.26.4",
|
||||
"tower-service",
|
||||
"webpki-roots",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4395,19 +4398,6 @@ dependencies = [
|
||||
"tower-service",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-tls"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"hyper 0.14.32",
|
||||
"native-tls",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-tls"
|
||||
version = "0.6.0"
|
||||
@@ -4608,7 +4598,7 @@ dependencies = [
|
||||
"netlink-proto",
|
||||
"netlink-sys",
|
||||
"rtnetlink",
|
||||
"system-configuration 0.6.1",
|
||||
"system-configuration",
|
||||
"tokio",
|
||||
"windows",
|
||||
]
|
||||
@@ -4691,7 +4681,7 @@ dependencies = [
|
||||
"metrics",
|
||||
"parking_lot",
|
||||
"rand 0.9.2",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"signing_method",
|
||||
@@ -6039,7 +6029,7 @@ dependencies = [
|
||||
"lighthouse_version",
|
||||
"metrics",
|
||||
"regex",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"sensitive_url",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -6613,7 +6603,7 @@ dependencies = [
|
||||
"bytes",
|
||||
"http 1.3.1",
|
||||
"opentelemetry",
|
||||
"reqwest 0.12.24",
|
||||
"reqwest",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6628,7 +6618,7 @@ dependencies = [
|
||||
"opentelemetry-proto",
|
||||
"opentelemetry_sdk",
|
||||
"prost",
|
||||
"reqwest 0.12.24",
|
||||
"reqwest",
|
||||
"thiserror 2.0.17",
|
||||
"tokio",
|
||||
"tonic 0.13.1",
|
||||
@@ -6994,7 +6984,7 @@ dependencies = [
|
||||
name = "pretty_reqwest_error"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"sensitive_url",
|
||||
]
|
||||
|
||||
@@ -7543,52 +7533,6 @@ version = "0.8.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
|
||||
|
||||
[[package]]
|
||||
name = "reqwest"
|
||||
version = "0.11.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62"
|
||||
dependencies = [
|
||||
"base64 0.21.7",
|
||||
"bytes",
|
||||
"encoding_rs",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"h2 0.3.27",
|
||||
"http 0.2.12",
|
||||
"http-body 0.4.6",
|
||||
"hyper 0.14.32",
|
||||
"hyper-rustls",
|
||||
"hyper-tls 0.5.0",
|
||||
"ipnet",
|
||||
"js-sys",
|
||||
"log",
|
||||
"mime",
|
||||
"native-tls",
|
||||
"once_cell",
|
||||
"percent-encoding",
|
||||
"pin-project-lite",
|
||||
"rustls 0.21.12",
|
||||
"rustls-pemfile 1.0.4",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_urlencoded",
|
||||
"sync_wrapper 0.1.2",
|
||||
"system-configuration 0.5.1",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
"tokio-rustls 0.24.1",
|
||||
"tokio-util",
|
||||
"tower-service",
|
||||
"url",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"wasm-streams",
|
||||
"web-sys",
|
||||
"webpki-roots",
|
||||
"winreg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "reqwest"
|
||||
version = "0.12.24"
|
||||
@@ -7604,34 +7548,41 @@ dependencies = [
|
||||
"http-body 1.0.1",
|
||||
"http-body-util",
|
||||
"hyper 1.8.1",
|
||||
"hyper-tls 0.6.0",
|
||||
"hyper-rustls",
|
||||
"hyper-tls",
|
||||
"hyper-util",
|
||||
"js-sys",
|
||||
"log",
|
||||
"native-tls",
|
||||
"percent-encoding",
|
||||
"pin-project-lite",
|
||||
"quinn",
|
||||
"rustls 0.23.35",
|
||||
"rustls-pki-types",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_urlencoded",
|
||||
"sync_wrapper 1.0.2",
|
||||
"sync_wrapper",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
"tokio-rustls 0.26.4",
|
||||
"tokio-util",
|
||||
"tower 0.5.2",
|
||||
"tower-http",
|
||||
"tower-service",
|
||||
"url",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"wasm-streams",
|
||||
"web-sys",
|
||||
"webpki-roots",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "reqwest-eventsource"
|
||||
version = "0.5.0"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f529a5ff327743addc322af460761dff5b50e0c826b9e6ac44c3195c50bb2026"
|
||||
checksum = "632c55746dbb44275691640e7b40c907c16a2dc1a5842aa98aaec90da6ec6bde"
|
||||
dependencies = [
|
||||
"eventsource-stream",
|
||||
"futures-core",
|
||||
@@ -7639,7 +7590,7 @@ dependencies = [
|
||||
"mime",
|
||||
"nom",
|
||||
"pin-project-lite",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
@@ -7871,18 +7822,6 @@ dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.21.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e"
|
||||
dependencies = [
|
||||
"log",
|
||||
"ring",
|
||||
"rustls-webpki 0.101.7",
|
||||
"sct",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.22.4"
|
||||
@@ -7924,15 +7863,6 @@ dependencies = [
|
||||
"security-framework 3.5.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-pemfile"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c"
|
||||
dependencies = [
|
||||
"base64 0.21.7",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-pemfile"
|
||||
version = "2.2.0"
|
||||
@@ -7952,16 +7882,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.101.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765"
|
||||
dependencies = [
|
||||
"ring",
|
||||
"untrusted",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.102.8"
|
||||
@@ -8109,16 +8029,6 @@ dependencies = [
|
||||
"sha2 0.9.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sct"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414"
|
||||
dependencies = [
|
||||
"ring",
|
||||
"untrusted",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sec1"
|
||||
version = "0.7.3"
|
||||
@@ -8456,7 +8366,7 @@ dependencies = [
|
||||
"ethereum_serde_utils",
|
||||
"lockfile",
|
||||
"parking_lot",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"task_executor",
|
||||
"types",
|
||||
@@ -8882,12 +8792,6 @@ dependencies = [
|
||||
"syn 2.0.110",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sync_wrapper"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
|
||||
|
||||
[[package]]
|
||||
name = "sync_wrapper"
|
||||
version = "1.0.2"
|
||||
@@ -8923,17 +8827,6 @@ dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "system-configuration"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"core-foundation 0.9.4",
|
||||
"system-configuration-sys 0.5.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "system-configuration"
|
||||
version = "0.6.1"
|
||||
@@ -8942,17 +8835,7 @@ checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
|
||||
dependencies = [
|
||||
"bitflags 2.10.0",
|
||||
"core-foundation 0.9.4",
|
||||
"system-configuration-sys 0.6.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "system-configuration-sys"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9"
|
||||
dependencies = [
|
||||
"core-foundation-sys",
|
||||
"libc",
|
||||
"system-configuration-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -9280,16 +9163,6 @@ dependencies = [
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-rustls"
|
||||
version = "0.24.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
|
||||
dependencies = [
|
||||
"rustls 0.21.12",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-rustls"
|
||||
version = "0.25.0"
|
||||
@@ -9457,7 +9330,7 @@ dependencies = [
|
||||
"indexmap 2.12.0",
|
||||
"pin-project-lite",
|
||||
"slab",
|
||||
"sync_wrapper 1.0.2",
|
||||
"sync_wrapper",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tower-layer",
|
||||
@@ -9883,7 +9756,7 @@ dependencies = [
|
||||
"metrics",
|
||||
"monitoring_api",
|
||||
"parking_lot",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"sensitive_url",
|
||||
"serde",
|
||||
"slashing_protection",
|
||||
@@ -10133,7 +10006,7 @@ dependencies = [
|
||||
"mime_guess",
|
||||
"percent-encoding",
|
||||
"pin-project",
|
||||
"rustls-pemfile 2.2.0",
|
||||
"rustls-pemfile",
|
||||
"scoped-tls",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -10296,7 +10169,7 @@ dependencies = [
|
||||
"lighthouse_validator_store",
|
||||
"logging",
|
||||
"parking_lot",
|
||||
"reqwest 0.11.27",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_yaml",
|
||||
@@ -10313,9 +10186,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "webpki-roots"
|
||||
version = "0.25.4"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1"
|
||||
checksum = "b2878ef029c47c6e8cf779119f20fcf52bde7ad42a731b2a304bc221df17571e"
|
||||
dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "which"
|
||||
|
||||
@@ -209,7 +209,7 @@ r2d2 = "0.8"
|
||||
rand = "0.9.0"
|
||||
rayon = "1.7"
|
||||
regex = "1"
|
||||
reqwest = { version = "0.11", default-features = false, features = [
|
||||
reqwest = { version = "0.12", default-features = false, features = [
|
||||
"blocking",
|
||||
"json",
|
||||
"stream",
|
||||
|
||||
@@ -46,6 +46,7 @@ pub use block_id::BlockId;
|
||||
use builder_states::get_next_withdrawals;
|
||||
use bytes::Bytes;
|
||||
use directory::DEFAULT_ROOT_DIR;
|
||||
use eth2::StatusCode;
|
||||
use eth2::types::{
|
||||
self as api_types, BroadcastValidation, ContextDeserialize, EndpointVersion, ForkChoice,
|
||||
ForkChoiceExtraData, ForkChoiceNode, LightClientUpdatesQuery, PublishBlockRequest,
|
||||
@@ -103,7 +104,6 @@ use version::{
|
||||
unsupported_version_rejection,
|
||||
};
|
||||
use warp::Reply;
|
||||
use warp::http::StatusCode;
|
||||
use warp::hyper::Body;
|
||||
use warp::sse::Event;
|
||||
use warp::{Filter, Rejection, http::Response};
|
||||
@@ -4097,7 +4097,7 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
convert_rejection(rx.await.unwrap_or_else(|_| {
|
||||
Ok(warp::reply::with_status(
|
||||
warp::reply::json(&"No response from channel"),
|
||||
eth2::StatusCode::INTERNAL_SERVER_ERROR,
|
||||
warp::http::StatusCode::INTERNAL_SERVER_ERROR,
|
||||
)
|
||||
.into_response())
|
||||
}))
|
||||
|
||||
@@ -9,9 +9,12 @@ use beacon_chain::{
|
||||
AvailabilityProcessingStatus, BeaconChain, BeaconChainError, BeaconChainTypes, BlockError,
|
||||
IntoGossipVerifiedBlock, NotifyExecutionLayer, build_blob_data_column_sidecars,
|
||||
};
|
||||
use eth2::types::{
|
||||
BlobsBundle, BroadcastValidation, ErrorMessage, ExecutionPayloadAndBlobs, FullPayloadContents,
|
||||
PublishBlockRequest, SignedBlockContents,
|
||||
use eth2::{
|
||||
StatusCode,
|
||||
types::{
|
||||
BlobsBundle, BroadcastValidation, ErrorMessage, ExecutionPayloadAndBlobs,
|
||||
FullPayloadContents, PublishBlockRequest, SignedBlockContents,
|
||||
},
|
||||
};
|
||||
use execution_layer::{ProvenancedPayload, SubmitBlindedBlockResponse};
|
||||
use futures::TryFutureExt;
|
||||
@@ -32,7 +35,6 @@ use types::{
|
||||
DataColumnSubnetId, EthSpec, ExecPayload, ExecutionBlockHash, ForkName, FullPayload,
|
||||
FullPayloadBellatrix, Hash256, KzgProofs, SignedBeaconBlock, SignedBlindedBeaconBlock,
|
||||
};
|
||||
use warp::http::StatusCode;
|
||||
use warp::{Rejection, Reply, reply::Response};
|
||||
|
||||
pub type UnverifiedBlobs<T> = Option<(
|
||||
@@ -302,7 +304,7 @@ pub async fn publish_block<T: BeaconChainTypes, B: IntoGossipVerifiedBlock<T>>(
|
||||
message: "duplicate block".to_string(),
|
||||
stacktraces: vec![],
|
||||
}),
|
||||
duplicate_status_code,
|
||||
warp_utils::status_code::convert(duplicate_status_code)?,
|
||||
)
|
||||
.into_response())
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ pretty_reqwest_error = { workspace = true }
|
||||
proto_array = { workspace = true }
|
||||
rand = { workspace = true }
|
||||
reqwest = { workspace = true }
|
||||
reqwest-eventsource = "0.5.0"
|
||||
reqwest-eventsource = "0.6.0"
|
||||
sensitive_url = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
@@ -5,5 +5,6 @@ pub mod cors;
|
||||
pub mod json;
|
||||
pub mod query;
|
||||
pub mod reject;
|
||||
pub mod status_code;
|
||||
pub mod task;
|
||||
pub mod uor;
|
||||
|
||||
9
common/warp_utils/src/status_code.rs
Normal file
9
common/warp_utils/src/status_code.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
use eth2::StatusCode;
|
||||
use warp::Rejection;
|
||||
|
||||
/// Convert from a "new" `http::StatusCode` to a `warp` compatible one.
|
||||
pub fn convert(code: StatusCode) -> Result<warp::http::StatusCode, Rejection> {
|
||||
code.as_u16().try_into().map_err(|e| {
|
||||
crate::reject::custom_server_error(format!("bad status code {code:?} - {e:?}"))
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user