2021-10-24 18:41:50 +00:00
|
|
|
use ethers_core::types::Chain;
|
2021-10-17 10:01:20 +00:00
|
|
|
use std::env::VarError;
|
|
|
|
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
|
|
pub enum EtherscanError {
|
2021-10-24 18:41:50 +00:00
|
|
|
#[error("chain {0} not supported")]
|
|
|
|
ChainNotSupported(Chain),
|
2021-10-17 10:01:20 +00:00
|
|
|
#[error("contract execution call failed: {0}")]
|
|
|
|
ExecutionFailed(String),
|
|
|
|
#[error("tx receipt failed")]
|
|
|
|
TransactionReceiptFailed,
|
|
|
|
#[error("bad status code {0}")]
|
|
|
|
BadStatusCode(String),
|
|
|
|
#[error(transparent)]
|
|
|
|
EnvVarNotFound(#[from] VarError),
|
|
|
|
#[error(transparent)]
|
|
|
|
Reqwest(#[from] reqwest::Error),
|
|
|
|
#[error(transparent)]
|
|
|
|
Serde(#[from] serde_json::Error),
|
|
|
|
}
|