Skip to content

Commit

Permalink
Add Debug to event type (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienGllmt authored Feb 27, 2023
1 parent 26c085b commit acbf44c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions indexer/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use dcspark_blockchain_source::cardano::Point;
use dcspark_blockchain_source::{EventObject, GetNextFrom};
use dcspark_core::{BlockId, SlotNumber};

#[derive(Debug)]
pub enum CardanoEventType {
RollBack {
block_slot: u64,
Expand Down
7 changes: 3 additions & 4 deletions indexer/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::time::Duration;

pub struct FetchEngine<
FromType: PullFrom + Clone,
EventType,
EventType: std::fmt::Debug,
SourceType: Source<From = FromType, Event = EventType> + StoppableService + Send,
SinkType: Sink<From = FromType, Event = EventType> + StoppableService + Send,
> {
Expand All @@ -21,7 +21,7 @@ pub struct FetchEngine<

impl<
FromType: PullFrom + Clone,
EventType: GetNextFrom<From = FromType>,
EventType: std::fmt::Debug + GetNextFrom<From = FromType>,
SourceType: Source<From = FromType, Event = EventType> + StoppableService + Send,
SinkType: Sink<From = FromType, Event = EventType> + StoppableService + Send,
> FetchEngine<FromType, EventType, SourceType, SinkType>
Expand Down Expand Up @@ -54,7 +54,6 @@ impl<
continue;
};
perf_aggregator.block_fetch += event_fetch_start.elapsed();

let new_from = event.next_from().unwrap_or(pull_from);
self.sink.process(event, &mut perf_aggregator).await?;
pull_from = new_from;
Expand All @@ -67,7 +66,7 @@ impl<
#[async_trait]
impl<
FromType: PullFrom + Clone,
EventType: GetNextFrom<From = FromType>,
EventType: std::fmt::Debug + GetNextFrom<From = FromType>,
SourceType: Source<From = FromType, Event = EventType> + StoppableService + Send,
SinkType: Sink<From = FromType, Event = EventType> + StoppableService + Send,
> StoppableService for FetchEngine<FromType, EventType, SourceType, SinkType>
Expand Down

0 comments on commit acbf44c

Please sign in to comment.