From 93df3141e2d4edcd82efc11c5514fa153bc6e5eb Mon Sep 17 00:00:00 2001 From: James Date: Thu, 7 Aug 2025 16:00:10 -0400 Subject: [PATCH] fix: export exexnotification --- Cargo.toml | 2 +- crates/test-utils/src/specs/mod.rs | 2 +- crates/test-utils/src/specs/notif_spec.rs | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c3ef4e03..f3bee9b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["crates/*"] resolver = "2" [workspace.package] -version = "0.9.0" +version = "0.9.1" edition = "2021" rust-version = "1.81" authors = ["init4"] diff --git a/crates/test-utils/src/specs/mod.rs b/crates/test-utils/src/specs/mod.rs index 3cd1e744..7db757b0 100644 --- a/crates/test-utils/src/specs/mod.rs +++ b/crates/test-utils/src/specs/mod.rs @@ -2,7 +2,7 @@ mod host_spec; pub use host_spec::HostBlockSpec; mod notif_spec; -pub use notif_spec::{NotificationSpec, NotificationWithSidecars}; +pub use notif_spec::{ExExNotification, NotificationSpec, NotificationWithSidecars}; mod ru_spec; pub use ru_spec::RuBlockSpec; diff --git a/crates/test-utils/src/specs/notif_spec.rs b/crates/test-utils/src/specs/notif_spec.rs index 24dd71d3..4becf16c 100644 --- a/crates/test-utils/src/specs/notif_spec.rs +++ b/crates/test-utils/src/specs/notif_spec.rs @@ -25,6 +25,26 @@ pub enum ExExNotification { }, } +impl ExExNotification { + /// Returns the committed chain, if any. + pub fn committed_chain(&self) -> Option<&Arc> { + match self { + ExExNotification::Committed { new } => Some(new), + ExExNotification::Reorged { new, .. } => Some(new), + ExExNotification::Reverted { .. } => None, + } + } + + /// Returns the reverted chain, if any. + pub fn reverted_chain(&self) -> Option<&Arc> { + match self { + ExExNotification::Reorged { old, .. } => Some(old), + ExExNotification::Reverted { old } => Some(old), + ExExNotification::Committed { .. } => None, + } + } +} + /// A notification spec. #[derive(Debug, Default)] pub struct NotificationSpec {