Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions crates/e2e-test-utils/src/testsuite/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand Down Expand Up @@ -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<
Expand All @@ -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"))?;
Expand Down