diff --git a/mithril-test-lab/mithril-end-to-end/src/devnet/mod.rs b/mithril-test-lab/mithril-end-to-end/src/devnet/mod.rs index 37b38d1f4a..551593c489 100644 --- a/mithril-test-lab/mithril-end-to-end/src/devnet/mod.rs +++ b/mithril-test-lab/mithril-end-to-end/src/devnet/mod.rs @@ -1,3 +1,3 @@ mod runner; -pub use runner::{Devnet, DevnetBootstrapArgs, DevnetTopology, PoolNode, UnrecoverableDevnetError}; +pub use runner::{Devnet, DevnetBootstrapArgs, DevnetTopology, PoolNode, RetryableDevnetError}; diff --git a/mithril-test-lab/mithril-end-to-end/src/devnet/runner.rs b/mithril-test-lab/mithril-end-to-end/src/devnet/runner.rs index 7e2547e386..c2312b9b15 100644 --- a/mithril-test-lab/mithril-end-to-end/src/devnet/runner.rs +++ b/mithril-test-lab/mithril-end-to-end/src/devnet/runner.rs @@ -10,8 +10,8 @@ use thiserror::Error; use tokio::process::Command; #[derive(Error, Debug, PartialEq, Eq)] -#[error("Unrecoverable devnet error: `{0}`")] -pub struct UnrecoverableDevnetError(pub String); +#[error("Retryable devnet error: `{0}`")] +pub struct RetryableDevnetError(pub String); #[derive(Debug, Clone, Default)] pub struct Devnet { @@ -216,7 +216,7 @@ impl Devnet { .with_context(|| "Error while starting the devnet")?; match status.code() { Some(0) => Ok(()), - Some(code) => Err(anyhow!(UnrecoverableDevnetError(format!( + Some(code) => Err(anyhow!(RetryableDevnetError(format!( "Run devnet exited with status code: {code}" )))), None => Err(anyhow!("Run devnet terminated by signal")), @@ -265,7 +265,7 @@ impl Devnet { .with_context(|| "Error while delegating stakes to the pools")?; match status.code() { Some(0) => Ok(()), - Some(code) => Err(anyhow!(UnrecoverableDevnetError(format!( + Some(code) => Err(anyhow!(RetryableDevnetError(format!( "Delegating stakes exited with status code: {code}" )))), None => Err(anyhow!("Delegating stakes terminated by signal")), @@ -291,7 +291,7 @@ impl Devnet { .with_context(|| "Error while writing era marker on chain")?; match status.code() { Some(0) => Ok(()), - Some(code) => Err(anyhow!(UnrecoverableDevnetError(format!( + Some(code) => Err(anyhow!(RetryableDevnetError(format!( "Write era marker on chain exited with status code: {code}" )))), None => Err(anyhow!("Write era marker on chain terminated by signal")), @@ -317,7 +317,7 @@ impl Devnet { .with_context(|| "Error while to transferring funds on chain")?; match status.code() { Some(0) => Ok(()), - Some(code) => Err(anyhow!(UnrecoverableDevnetError(format!( + Some(code) => Err(anyhow!(RetryableDevnetError(format!( "Transfer funds on chain exited with status code: {code}" )))), None => Err(anyhow!("Transfer funds on chain terminated by signal")), diff --git a/mithril-test-lab/mithril-end-to-end/src/main.rs b/mithril-test-lab/mithril-end-to-end/src/main.rs index 1e5f67439a..77efedd372 100644 --- a/mithril-test-lab/mithril-end-to-end/src/main.rs +++ b/mithril-test-lab/mithril-end-to-end/src/main.rs @@ -18,8 +18,8 @@ use tokio::{ use mithril_common::StdResult; use mithril_doc::GenerateDocCommands; use mithril_end_to_end::{ - Devnet, DevnetBootstrapArgs, MithrilInfrastructure, MithrilInfrastructureConfig, RunOnly, Spec, - UnrecoverableDevnetError, + Devnet, DevnetBootstrapArgs, MithrilInfrastructure, MithrilInfrastructureConfig, + RetryableDevnetError, RunOnly, Spec, }; /// Tests args @@ -257,7 +257,7 @@ impl From> for AppResult { match result { Ok(()) => AppResult::Success(), Err(error) => { - if error.is::() { + if error.is::() { AppResult::RetryableError(error) } else { AppResult::UnretryableError(error) @@ -466,9 +466,7 @@ mod tests { assert!(matches!(AppResult::from(Ok(())), AppResult::Success())); assert!(matches!( - AppResult::from(Err(anyhow!(UnrecoverableDevnetError( - "an error".to_string() - )))), + AppResult::from(Err(anyhow!(RetryableDevnetError("an error".to_string())))), AppResult::RetryableError(_) ));