mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: remove unused async (#9299)
This commit is contained in:
@ -71,11 +71,11 @@ impl LaunchContext {
|
||||
/// `config`.
|
||||
///
|
||||
/// Attaches both the `NodeConfig` and the loaded `reth.toml` config to the launch context.
|
||||
pub async fn with_loaded_toml_config(
|
||||
pub fn with_loaded_toml_config(
|
||||
self,
|
||||
config: NodeConfig,
|
||||
) -> eyre::Result<LaunchContextWith<WithConfigs>> {
|
||||
let toml_config = self.load_toml_config(&config).await?;
|
||||
let toml_config = self.load_toml_config(&config)?;
|
||||
Ok(self.with(WithConfigs { config, toml_config }))
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ impl LaunchContext {
|
||||
/// `config`.
|
||||
///
|
||||
/// This is async because the trusted peers may have to be resolved.
|
||||
pub async fn load_toml_config(&self, config: &NodeConfig) -> eyre::Result<reth_config::Config> {
|
||||
pub fn load_toml_config(&self, config: &NodeConfig) -> eyre::Result<reth_config::Config> {
|
||||
let config_path = config.config.clone().unwrap_or_else(|| self.data_dir.config());
|
||||
|
||||
let mut toml_config = confy::load_path::<reth_config::Config>(&config_path)
|
||||
@ -518,7 +518,7 @@ where
|
||||
}
|
||||
|
||||
/// Creates a `BlockchainProvider` and attaches it to the launch context.
|
||||
pub async fn with_blockchain_db<T>(
|
||||
pub fn with_blockchain_db<T>(
|
||||
self,
|
||||
) -> eyre::Result<LaunchContextWith<Attached<WithConfigs, WithMeteredProviders<DB, T>>>>
|
||||
where
|
||||
|
||||
@ -104,7 +104,7 @@ where
|
||||
let ctx = ctx
|
||||
.with_configured_globals()
|
||||
// load the toml config
|
||||
.with_loaded_toml_config(config).await?
|
||||
.with_loaded_toml_config(config)?
|
||||
// add resolved peers
|
||||
.with_resolved_peers().await?
|
||||
// attach the database
|
||||
@ -127,7 +127,7 @@ where
|
||||
.with_metrics()
|
||||
// passing FullNodeTypes as type parameter here so that we can build
|
||||
// later the components.
|
||||
.with_blockchain_db::<T>().await?
|
||||
.with_blockchain_db::<T>()?
|
||||
.with_components(components_builder, on_component_initialized).await?;
|
||||
|
||||
// spawn exexs
|
||||
@ -201,8 +201,7 @@ where
|
||||
static_file_producer,
|
||||
ctx.components().block_executor().clone(),
|
||||
pipeline_exex_handle,
|
||||
)
|
||||
.await?;
|
||||
)?;
|
||||
|
||||
let pipeline_events = pipeline.events();
|
||||
task.set_pipeline_events(pipeline_events);
|
||||
@ -223,8 +222,7 @@ where
|
||||
static_file_producer,
|
||||
ctx.components().block_executor().clone(),
|
||||
pipeline_exex_handle,
|
||||
)
|
||||
.await?;
|
||||
)?;
|
||||
|
||||
(pipeline, Either::Right(network_client.clone()))
|
||||
};
|
||||
|
||||
@ -24,7 +24,7 @@ use tokio::sync::watch;
|
||||
|
||||
/// Constructs a [Pipeline] that's wired to the network
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn build_networked_pipeline<DB, Client, Executor>(
|
||||
pub fn build_networked_pipeline<DB, Client, Executor>(
|
||||
config: &StageConfig,
|
||||
client: Client,
|
||||
consensus: Arc<dyn Consensus>,
|
||||
@ -63,15 +63,14 @@ where
|
||||
static_file_producer,
|
||||
executor,
|
||||
exex_manager_handle,
|
||||
)
|
||||
.await?;
|
||||
)?;
|
||||
|
||||
Ok(pipeline)
|
||||
}
|
||||
|
||||
/// Builds the [Pipeline] with the given [`ProviderFactory`] and downloaders.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn build_pipeline<DB, H, B, Executor>(
|
||||
pub fn build_pipeline<DB, H, B, Executor>(
|
||||
provider_factory: ProviderFactory<DB>,
|
||||
stage_config: &StageConfig,
|
||||
header_downloader: H,
|
||||
|
||||
Reference in New Issue
Block a user