chore: add bundle api helper (#5119)

This commit is contained in:
Matthias Seitz
2023-10-21 13:37:46 +02:00
committed by GitHub
parent 2045171d26
commit 3a8fe5a734

View File

@ -159,6 +159,7 @@ pub use crate::eth::{EthConfig, EthHandlers};
pub use jsonrpsee::server::ServerBuilder;
pub use reth_ipc::server::{Builder as IpcServerBuilder, Endpoint};
use reth_network_api::noop::NoopNetwork;
use reth_rpc::eth::EthBundle;
use reth_transaction_pool::noop::NoopTransactionPool;
/// Convenience function for starting a server in one step.
@ -1076,6 +1077,12 @@ where
TraceApi::new(self.provider.clone(), eth.api, self.blocking_pool_guard.clone())
}
/// Instantiates [EthBundle] Api
pub fn bundle_api(&mut self) -> EthBundle<EthApi<Provider, Pool, Network>> {
let eth_api = self.eth_api();
EthBundle::new(eth_api, self.blocking_pool_guard.clone())
}
/// Instantiates OtterscanApi
pub fn otterscan_api(&mut self) -> OtterscanApi<EthApi<Provider, Pool, Network>> {
let eth_api = self.eth_api();