From 0c998d3300f73451e1985698bf68a61db2b4ee54 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 6 Aug 2024 22:08:10 +0200 Subject: [PATCH] chore(dep): feature gate jwt in engine types (#1131) * chore(dep): feature gate jwt in engine types * rm rand --- crates/rpc-types-engine/Cargo.toml | 6 ++++-- crates/rpc-types-engine/src/lib.rs | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/rpc-types-engine/Cargo.toml b/crates/rpc-types-engine/Cargo.toml index dbc30871e26..48d3c4332d8 100644 --- a/crates/rpc-types-engine/Cargo.toml +++ b/crates/rpc-types-engine/Cargo.toml @@ -38,10 +38,12 @@ thiserror.workspace = true jsonrpsee-types = { version = "0.24", optional = true } # jwt -jsonwebtoken = "9.3.0" -rand.workspace = true +jsonwebtoken = { version = "9.3.0", optional = true } +rand = { workspace = true, optional = true } [features] +default = ["jwt"] +jwt = ["dep:jsonwebtoken", "dep:rand"] jsonrpsee-types = ["dep:jsonrpsee-types"] ssz = [ "dep:ethereum_ssz", diff --git a/crates/rpc-types-engine/src/lib.rs b/crates/rpc-types-engine/src/lib.rs index 4e5b9c52fea..a8ef6b7a6d1 100644 --- a/crates/rpc-types-engine/src/lib.rs +++ b/crates/rpc-types-engine/src/lib.rs @@ -9,15 +9,19 @@ mod cancun; mod forkchoice; mod identification; +#[cfg(feature = "jwt")] mod jwt; mod optimism; pub mod payload; mod transition; pub use self::{ - cancun::*, forkchoice::*, identification::*, jwt::*, optimism::*, payload::*, transition::*, + cancun::*, forkchoice::*, identification::*, optimism::*, payload::*, transition::*, }; +#[cfg(feature = "jwt")] +pub use self::jwt::*; + #[doc(inline)] pub use alloy_eips::eip6110::DepositRequest as DepositRequestV1;