use alloy_dyn_abi::Error as AbiError;
use alloy_primitives::Selector;
use alloy_provider::PendingTransactionError;
use alloy_transport::TransportError;
use thiserror::Error;
pub type Result<T, E = Error> = core::result::Result<T, E>;
#[derive(Debug, Error)]
pub enum Error {
#[error("unknown function: function {0} does not exist")]
UnknownFunction(String),
#[error("unknown function: function with selector {0} does not exist")]
UnknownSelector(Selector),
#[error("transaction is not a deployment transaction")]
NotADeploymentTransaction,
#[error("missing `contractAddress` from deployment transaction receipt")]
ContractNotDeployed,
#[error(transparent)]
AbiError(#[from] AbiError),
#[error(transparent)]
TransportError(#[from] TransportError),
#[error(transparent)]
PendingTransactionError(#[from] PendingTransactionError),
}
impl From<alloy_sol_types::Error> for Error {
#[inline]
fn from(e: alloy_sol_types::Error) -> Self {
Self::AbiError(e.into())
}
}