fix: box some more futures (#17864)

This commit is contained in:
DaniPopes
2025-08-13 20:45:02 +02:00
committed by GitHub
parent 544eed8b72
commit 4e20417a87

View File

@@ -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"))?;