From b5581337a84d3231afa3b29d15caf42902766b3c Mon Sep 17 00:00:00 2001 From: Danil Nemirovsky <4614623+ameten@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:55:38 +0000 Subject: [PATCH] aoeu --- .../src/contract_sync/cursors/sequence_aware/mod.rs | 4 ++-- rust/main/hyperlane-base/src/contract_sync/mod.rs | 1 + rust/main/hyperlane-core/src/traits/indexer.rs | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rust/main/hyperlane-base/src/contract_sync/cursors/sequence_aware/mod.rs b/rust/main/hyperlane-base/src/contract_sync/cursors/sequence_aware/mod.rs index 89a30ec1ea..f1e1f0aacb 100644 --- a/rust/main/hyperlane-base/src/contract_sync/cursors/sequence_aware/mod.rs +++ b/rust/main/hyperlane-base/src/contract_sync/cursors/sequence_aware/mod.rs @@ -67,8 +67,8 @@ pub enum SyncDirection { pub(crate) struct ForwardBackwardSequenceAwareSyncCursor { forward: ForwardSequenceAwareSyncCursor, backward: BackwardSequenceAwareSyncCursor, - last_direction: SyncDirection, index_direction: IndexDirection, + last_direction: SyncDirection, } impl ForwardBackwardSequenceAwareSyncCursor { @@ -99,8 +99,8 @@ impl ForwardBackwardSequenceAwareSyncCursor { Ok(Self { forward: forward_cursor, backward: backward_cursor, - last_direction: SyncDirection::Forward, index_direction: direction, + last_direction: SyncDirection::Forward, }) } } diff --git a/rust/main/hyperlane-base/src/contract_sync/mod.rs b/rust/main/hyperlane-base/src/contract_sync/mod.rs index 340417aa31..2d77eb6dc5 100644 --- a/rust/main/hyperlane-base/src/contract_sync/mod.rs +++ b/rust/main/hyperlane-base/src/contract_sync/mod.rs @@ -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( diff --git a/rust/main/hyperlane-core/src/traits/indexer.rs b/rust/main/hyperlane-core/src/traits/indexer.rs index 070f2355ff..bfe28b1b8b 100644 --- a/rust/main/hyperlane-core/src/traits/indexer.rs +++ b/rust/main/hyperlane-core/src/traits/indexer.rs @@ -38,6 +38,7 @@ pub enum IndexDirection { } impl IndexDirection { + /// Returns true if direction allows forward. pub fn can_backward(&self) -> bool { match self { IndexDirection::Both | IndexDirection::Backward => true, @@ -45,6 +46,7 @@ impl IndexDirection { } } + /// Returns true if direction allows backward. pub fn can_forward(&self) -> bool { match self { IndexDirection::Both | IndexDirection::Forward => true,