From 6b35352496bafdf57e380d0f767dd6e1bad797a7 Mon Sep 17 00:00:00 2001 From: llacqie Date: Fri, 11 Aug 2023 12:39:23 +0500 Subject: [PATCH] Make sync_state optional --- crates/artemis-core/src/types.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/artemis-core/src/types.rs b/crates/artemis-core/src/types.rs index a26118e..70de4b4 100644 --- a/crates/artemis-core/src/types.rs +++ b/crates/artemis-core/src/types.rs @@ -25,7 +25,9 @@ pub trait Collector: Send + Sync { pub trait Strategy: Send + Sync { /// Sync the initial state of the strategy if needed, usually by fetching /// onchain data. - async fn sync_state(&mut self) -> Result<()>; + async fn sync_state(&mut self) -> Result<()> { + Ok(()) + } /// Process an event, and return an action if needed. async fn process_event(&mut self, event: E) -> Vec;