diff --git a/crates/light-client-verifier/src/mock.rs b/crates/light-client-verifier/src/mock.rs index 421c812..9ac6592 100644 --- a/crates/light-client-verifier/src/mock.rs +++ b/crates/light-client-verifier/src/mock.rs @@ -109,4 +109,13 @@ impl LightClientStoreReader Option> { self.next_sync_committee.clone() } + + fn ensure_relevant_update>( + &self, + _ctx: &CC, + _update: &C, + ) -> Result<(), crate::errors::Error> { + // every update is relevant + Ok(()) + } } diff --git a/crates/light-client-verifier/src/state.rs b/crates/light-client-verifier/src/state.rs index 14c151a..e097104 100644 --- a/crates/light-client-verifier/src/state.rs +++ b/crates/light-client-verifier/src/state.rs @@ -8,10 +8,10 @@ pub trait LightClientStoreReader { /// Returns the current sync committee period fn current_period(&self, ctx: &CC) -> SyncCommitteePeriod; - /// Returns the current sync committee corresponding to the current period if available + /// Returns the current sync committee corresponding to the `current_period()` if available fn current_sync_committee(&self) -> Option>; - /// Returns the next sync committee corresponding to the next period if available + /// Returns the next sync committee corresponding to the `current_period() + 1` if available fn next_sync_committee(&self) -> Option>; /// Returns the sync committee corresponding to the given signature period if available @@ -31,14 +31,12 @@ pub trait LightClientStoreReader { } } - /// Returns a error indicating whether the update is relevant to the light client store. + /// Returns a error indicating whether the update is relevant to this store. /// /// This method should be used to determine whether the update should be applied to the store. fn ensure_relevant_update>( &self, - _ctx: &CC, - _update: &C, - ) -> Result<(), Error> { - Ok(()) - } + ctx: &CC, + update: &C, + ) -> Result<(), Error>; }