use crate::{PipelineErrorKind, PipelineResult};
use alloc::{boxed::Box, fmt::Debug, string::ToString, vec::Vec};
use alloy_eips::eip4844::{Blob, IndexedBlobHash};
use alloy_primitives::{Address, Bytes};
use async_trait::async_trait;
use core::fmt::Display;
use kona_protocol::BlockInfo;
#[async_trait]
pub trait BlobProvider {
type Error: Display + ToString + Into<PipelineErrorKind>;
async fn get_blobs(
&mut self,
block_ref: &BlockInfo,
blob_hashes: &[IndexedBlobHash],
) -> Result<Vec<Box<Blob>>, Self::Error>;
}
#[async_trait]
pub trait DataAvailabilityProvider {
type Item: Send + Sync + Debug + Into<Bytes>;
async fn next(
&mut self,
block_ref: &BlockInfo,
batcher_addr: Address,
) -> PipelineResult<Self::Item>;
fn clear(&mut self);
}