use alloy::rpc::types::Log;
use thiserror::Error;
use crate::storage::codec::decoder::DecodedEventWithHeader;
pub mod backfill;
pub mod config;
pub mod error_tracking;
pub mod events;
pub mod heads;
pub mod provider;
pub mod stream;
#[derive(Debug, Clone, Error)]
pub enum RpcError {
#[error("Connection Error: {0}")]
ConnectionError(String),
#[error("Subscription Error: {0}")]
SubscriptionError(String),
#[error("Log Fetch Error: {0}")]
LogFetchError(String),
#[error("Transport Error: {0}")]
TransportError(String),
#[error("All Providers Suspended: {0}")]
AllProvidersSuspended(String),
#[error("Other Error: {0}")]
Other(String),
}
pub type LogRange = (u64, u64, Vec<Log>);
pub type DecodedEventRange = (u64, u64, Vec<DecodedEventWithHeader>);