chore: update authmodule new with new engine trait (#14206)

This commit is contained in:
Matthias Seitz
2025-02-04 17:48:18 +01:00
committed by GitHub
parent b6ce1d90fd
commit 1303bb5dc6

View File

@ -6,7 +6,6 @@ use jsonrpsee::{
server::{AlreadyStoppedError, RpcModule}, server::{AlreadyStoppedError, RpcModule},
Methods, Methods,
}; };
use reth_engine_primitives::EngineTypes;
use reth_rpc_api::servers::*; use reth_rpc_api::servers::*;
use reth_rpc_eth_types::EthSubscriptionIdProvider; use reth_rpc_eth_types::EthSubscriptionIdProvider;
use reth_rpc_layer::{ use reth_rpc_layer::{
@ -189,18 +188,10 @@ pub struct AuthRpcModule {
pub(crate) inner: RpcModule<()>, pub(crate) inner: RpcModule<()>,
} }
// === impl AuthRpcModule ===
impl AuthRpcModule { impl AuthRpcModule {
/// Create a new `AuthRpcModule` with the given `engine_api`. /// Create a new `AuthRpcModule` with the given `engine_api`.
pub fn new<EngineApi, EngineT>(engine: EngineApi) -> Self pub fn new(engine: impl IntoEngineApiRpcModule) -> Self {
where Self { inner: engine.into_rpc_module() }
EngineT: EngineTypes,
EngineApi: EngineApiServer<EngineT>,
{
let mut module = RpcModule::new(());
module.merge(engine.into_rpc()).expect("No conflicting methods");
Self { inner: module }
} }
/// Get a reference to the inner `RpcModule`. /// Get a reference to the inner `RpcModule`.