Skip to content

Commit

Permalink
fix(plasma): reduce plasma source generic verbosity (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell authored Apr 28, 2024
1 parent 1cdb2fe commit c80b713
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions crates/plasma/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,41 @@ use kona_primitives::block::BlockID;

/// A plasma data iterator.
#[derive(Debug, Clone)]
pub struct PlasmaSource<CP, PIF, I>
pub struct PlasmaSource<C, F, I>
where
CP: ChainProvider + Send,
PIF: PlasmaInputFetcher<CP> + Send,
C: ChainProvider + Send,
F: PlasmaInputFetcher<C> + Send,
I: Iterator<Item = Bytes>,
{
/// The plasma input fetcher.
input_fetcher: PIF,
/// The chain provider to use for the plasma source.
chain_provider: CP,
pub chain_provider: C,
/// The plasma input fetcher.
pub input_fetcher: F,
/// A source data iterator.
source: I,
pub source: I,
/// Keeps track of a pending commitment so we can keep trying to fetch the input.
commitment: Option<Keccak256Commitment>,
/// The block Id.
id: BlockID,
pub commitment: Option<Keccak256Commitment>,
/// The block id.
pub id: BlockID,
}

impl<CP, PIF, I> PlasmaSource<CP, PIF, I>
impl<C, F, I> PlasmaSource<C, F, I>
where
CP: ChainProvider + Send,
PIF: PlasmaInputFetcher<CP> + Send,
C: ChainProvider + Send,
F: PlasmaInputFetcher<C> + Send,
I: Iterator<Item = Bytes>,
{
/// Instantiates a new plasma data source.
pub fn new(chain_provider: CP, input_fetcher: PIF, source: I, id: BlockID) -> Self {
pub fn new(chain_provider: C, input_fetcher: F, source: I, id: BlockID) -> Self {
Self { chain_provider, input_fetcher, source, id, commitment: None }
}
}

#[async_trait]
impl<CP, PIF, I> AsyncIterator for PlasmaSource<CP, PIF, I>
impl<C, F, I> AsyncIterator for PlasmaSource<C, F, I>
where
CP: ChainProvider + Send,
PIF: PlasmaInputFetcher<CP> + Send,
C: ChainProvider + Send,
F: PlasmaInputFetcher<C> + Send,
I: Iterator<Item = Bytes> + Send,
{
type Item = Bytes;
Expand Down

0 comments on commit c80b713

Please sign in to comment.