Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Debug to event type #141

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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