mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-19 03:04:27 -05:00
fix: box some more futures (#17864)
This commit is contained in:
@@ -141,6 +141,22 @@ where
|
||||
env: &mut Environment<I>,
|
||||
rlp_path: &Path,
|
||||
) -> Result<()>
|
||||
where
|
||||
N: NodeBuilderHelper,
|
||||
LocalPayloadAttributesBuilder<N::ChainSpec>: PayloadAttributesBuilder<
|
||||
<<N as NodeTypes>::Payload as PayloadTypes>::PayloadAttributes,
|
||||
>,
|
||||
{
|
||||
// Note: this future is quite large so we box it
|
||||
Box::pin(self.apply_with_import_::<N>(env, rlp_path)).await
|
||||
}
|
||||
|
||||
/// Apply setup using pre-imported chain data from RLP file
|
||||
async fn apply_with_import_<N>(
|
||||
&mut self,
|
||||
env: &mut Environment<I>,
|
||||
rlp_path: &Path,
|
||||
) -> Result<()>
|
||||
where
|
||||
N: NodeBuilderHelper,
|
||||
LocalPayloadAttributesBuilder<N::ChainSpec>: PayloadAttributesBuilder<
|
||||
@@ -172,6 +188,18 @@ where
|
||||
|
||||
/// Apply the setup to the environment
|
||||
pub async fn apply<N>(&mut self, env: &mut Environment<I>) -> Result<()>
|
||||
where
|
||||
N: NodeBuilderHelper,
|
||||
LocalPayloadAttributesBuilder<N::ChainSpec>: PayloadAttributesBuilder<
|
||||
<<N as NodeTypes>::Payload as PayloadTypes>::PayloadAttributes,
|
||||
>,
|
||||
{
|
||||
// Note: this future is quite large so we box it
|
||||
Box::pin(self.apply_::<N>(env)).await
|
||||
}
|
||||
|
||||
/// Apply the setup to the environment
|
||||
async fn apply_<N>(&mut self, env: &mut Environment<I>) -> Result<()>
|
||||
where
|
||||
N: NodeBuilderHelper,
|
||||
LocalPayloadAttributesBuilder<N::ChainSpec>: PayloadAttributesBuilder<
|
||||
@@ -180,8 +208,7 @@ where
|
||||
{
|
||||
// If import_rlp_path is set, use apply_with_import instead
|
||||
if let Some(rlp_path) = self.import_rlp_path.take() {
|
||||
// Note: this future is quite large so we box it
|
||||
return Box::pin(self.apply_with_import::<N>(env, &rlp_path)).await;
|
||||
return self.apply_with_import::<N>(env, &rlp_path).await;
|
||||
}
|
||||
let chain_spec =
|
||||
self.chain_spec.clone().ok_or_else(|| eyre!("Chain specification is required"))?;
|
||||
|
||||
Reference in New Issue
Block a user