diff --git a/pallas-rolldb/src/wal/store.rs b/pallas-rolldb/src/wal/store.rs
index 7f55c42..1275a74 100644
--- a/pallas-rolldb/src/wal/store.rs
+++ b/pallas-rolldb/src/wal/store.rs
@@ -82,6 +82,26 @@ impl Log {
pub fn is_origin(&self) -> bool {
matches!(self, Log::Origin)
}
+
+ /// Checks if entry is a forward event (apply or mark)
+ pub fn is_forward(&self) -> bool {
+ self.is_mark() || self.is_apply()
+ }
+
+ /// Checks if entry is a forward event that matches the specified point
+ pub fn equals_point(&self, point: &(BlockSlot, BlockHash)) -> bool {
+ if !self.is_forward() {
+ return false;
+ }
+
+ self.slot().is_some_and(|x| x == point.0) && self.hash().is_some_and(|x| x.eq(&point.1))
+ }
+
+ /// Checks if entry is a forward event that matches any of the specified
+ /// points
+ pub fn equals_any_point(&self, points: &[(BlockSlot, BlockHash)]) -> bool {
+ points.iter().any(|x| self.equals_point(x))
+ }
}
// slot => block hash
@@ -303,25 +323,13 @@ impl Store {
}
}
- pub fn find_wal_seq(
- &self,
- block: Option<(BlockSlot, BlockHash)>,
- ) -> Result