Skip to content

Commit

Permalink
aoeu
Browse files Browse the repository at this point in the history
  • Loading branch information
ameten committed Dec 12, 2024
1 parent 0877586 commit b558133
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ pub enum SyncDirection {
pub(crate) struct ForwardBackwardSequenceAwareSyncCursor<T> {
forward: ForwardSequenceAwareSyncCursor<T>,
backward: BackwardSequenceAwareSyncCursor<T>,
last_direction: SyncDirection,
index_direction: IndexDirection,
last_direction: SyncDirection,
}

impl<T: Debug> ForwardBackwardSequenceAwareSyncCursor<T> {
Expand Down Expand Up @@ -99,8 +99,8 @@ impl<T: Debug> ForwardBackwardSequenceAwareSyncCursor<T> {
Ok(Self {
forward: forward_cursor,
backward: backward_cursor,
last_direction: SyncDirection::Forward,
index_direction: direction,
last_direction: SyncDirection::Forward,
})
}
}
Expand Down
1 change: 1 addition & 0 deletions rust/main/hyperlane-base/src/contract_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ where
from: watermark.unwrap_or(index_settings.from),
chunk_size: index_settings.chunk_size,
mode: index_settings.mode,
direction: index_settings.direction,
};
Ok(Box::new(
RateLimitedContractSyncCursor::new(
Expand Down
2 changes: 2 additions & 0 deletions rust/main/hyperlane-core/src/traits/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ pub enum IndexDirection {
}

impl IndexDirection {
/// Returns true if direction allows forward.
pub fn can_backward(&self) -> bool {
match self {
IndexDirection::Both | IndexDirection::Backward => true,
IndexDirection::Forward => false,
}
}

/// Returns true if direction allows backward.
pub fn can_forward(&self) -> bool {
match self {
IndexDirection::Both | IndexDirection::Forward => true,
Expand Down

0 comments on commit b558133

Please sign in to comment.