mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: update authmodule new with new engine trait (#14206)
This commit is contained in:
@ -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`.
|
||||||
|
|||||||
Reference in New Issue
Block a user