Skip to content

Commit 6d61936

Browse files
authored
fix: Add tests for functions identifying if messages are already submitted (#7346)
Co-authored-by: Danil Nemirovsky <4614623+ameten@users.noreply.github.com>
1 parent f039aea commit 6d61936

4 files changed

Lines changed: 1584 additions & 3 deletions

File tree

rust/main/agents/relayer/src/msg/message_processor.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ async fn prepare_lander_task(
400400
};
401401

402402
let batch_to_process = confirm_already_submitted_operations(
403-
entrypoint.clone(),
403+
entrypoint.clone() as Arc<dyn Entrypoint + Send + Sync>,
404404
&confirm_queue,
405405
db.clone(),
406406
batch,
@@ -423,7 +423,7 @@ async fn prepare_lander_task(
423423
/// If the payload is not dropped, the operation is pushed to the confirmation queue.
424424
/// If the payload is dropped, does not exist or there is issue in retrieving payload or its status, the operation will go through prepare logic.
425425
async fn confirm_already_submitted_operations(
426-
entrypoint: Arc<DispatcherEntrypoint>,
426+
entrypoint: Arc<dyn Entrypoint + Send + Sync>,
427427
confirm_queue: &OpQueue,
428428
db: Arc<dyn HyperlaneDb>,
429429
batch: Vec<QueueOperation>,
@@ -448,7 +448,7 @@ async fn confirm_already_submitted_operations(
448448
}
449449

450450
async fn has_operation_been_submitted(
451-
entrypoint: Arc<DispatcherEntrypoint>,
451+
entrypoint: Arc<dyn Entrypoint + Send + Sync>,
452452
db: Arc<dyn HyperlaneDb>,
453453
op: &QueueOperation,
454454
) -> bool {
@@ -1073,3 +1073,6 @@ impl MessageProcessorMetrics {
10731073
}
10741074
}
10751075
}
1076+
1077+
#[cfg(test)]
1078+
mod tests;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mod tests_confirm_already_submitted_operations;
2+
mod tests_has_operation_been_submitted;

0 commit comments

Comments
 (0)