File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
crates/test-utils/src/specs Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ members = ["crates/*"]
33resolver = " 2"
44
55[workspace .package ]
6- version = " 0.9.0 "
6+ version = " 0.9.1 "
77edition = " 2021"
88rust-version = " 1.81"
99authors = [" init4" ]
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ mod host_spec;
22pub use host_spec:: HostBlockSpec ;
33
44mod notif_spec;
5- pub use notif_spec:: { NotificationSpec , NotificationWithSidecars } ;
5+ pub use notif_spec:: { ExExNotification , NotificationSpec , NotificationWithSidecars } ;
66
77mod ru_spec;
88pub use ru_spec:: RuBlockSpec ;
Original file line number Diff line number Diff line change @@ -25,6 +25,26 @@ pub enum ExExNotification {
2525 } ,
2626}
2727
28+ impl ExExNotification {
29+ /// Returns the committed chain, if any.
30+ pub fn committed_chain ( & self ) -> Option < & Arc < Chain > > {
31+ match self {
32+ ExExNotification :: Committed { new } => Some ( new) ,
33+ ExExNotification :: Reorged { new, .. } => Some ( new) ,
34+ ExExNotification :: Reverted { .. } => None ,
35+ }
36+ }
37+
38+ /// Returns the reverted chain, if any.
39+ pub fn reverted_chain ( & self ) -> Option < & Arc < Chain > > {
40+ match self {
41+ ExExNotification :: Reorged { old, .. } => Some ( old) ,
42+ ExExNotification :: Reverted { old } => Some ( old) ,
43+ ExExNotification :: Committed { .. } => None ,
44+ }
45+ }
46+ }
47+
2848/// A notification spec.
2949#[ derive( Debug , Default ) ]
3050pub struct NotificationSpec {
You can’t perform that action at this time.
0 commit comments