blueprint_chain_setup_anvil/
error.rs

1#[derive(thiserror::Error, Debug)]
2pub enum Error {
3    #[error("Error occurred in Testnet: {0}")]
4    Container(String),
5    #[error("Failed to mine anvil blocks: {0}")]
6    Mine(String),
7    #[error("Error occurred while waiting for responses: {0}")]
8    WaitResponse(String),
9    #[error("Contract Error: {0}")]
10    Contract(#[from] alloy_contract::Error),
11    #[error("Transaction Error: {0}")]
12    Transaction(#[from] alloy_provider::PendingTransactionError),
13    #[error("Keystore error: {0}")]
14    Keystore(#[from] Box<blueprint_keystore::Error>),
15}
16
17impl From<tokio::time::error::Elapsed> for Error {
18    fn from(e: tokio::time::error::Elapsed) -> Self {
19        Error::WaitResponse(e.to_string())
20    }
21}
22
23impl From<blueprint_keystore::Error> for Error {
24    fn from(e: blueprint_keystore::Error) -> Self {
25        Box::new(e).into()
26    }
27}