@@ -83,16 +83,26 @@ async fn test_should_detect_reorg() -> eyre::Result<()> {
8383 for ( latest, finalized) in latest_blocks[ 1 ..] . iter ( ) . zip ( finalized_blocks[ 1 ..] . iter ( ) ) {
8484 // check finalized first.
8585 if finalized_number < finalized. header . number {
86- let notification = l1_watcher. recv ( ) . await . unwrap ( ) ;
86+ let mut notification = l1_watcher. recv ( ) . await . unwrap ( ) ;
87+ // skip the `L1Notification::Processed` notifications
88+ if matches ! ( notification. as_ref( ) , L1Notification :: Processed ( _) ) {
89+ notification = l1_watcher. recv ( ) . await . unwrap ( ) ;
90+ }
8791 assert_eq ! ( notification. as_ref( ) , & L1Notification :: Finalized ( finalized. header. number) ) ;
8892 }
8993
9094 if latest_number == latest. header . number {
9195 continue
9296 }
9397
94- // skip the `L1Notification::Synced` notifications
9598 let mut notification = l1_watcher. recv ( ) . await . unwrap ( ) ;
99+
100+ // skip the `L1Notification::Processed` notifications
101+ if matches ! ( notification. as_ref( ) , L1Notification :: Processed ( _) ) {
102+ notification = l1_watcher. recv ( ) . await . unwrap ( ) ;
103+ }
104+
105+ // skip the `L1Notification::Synced` notifications
96106 if matches ! ( notification. as_ref( ) , L1Notification :: Synced ) {
97107 notification = l1_watcher. recv ( ) . await . unwrap ( ) ;
98108 }
@@ -174,16 +184,26 @@ async fn test_should_fetch_gap_in_unfinalized_blocks() -> eyre::Result<()> {
174184 for ( latest, finalized) in latest_blocks[ 1 ..] . iter ( ) . zip ( finalized_blocks[ 1 ..] . iter ( ) ) {
175185 // check finalized first.
176186 if finalized_number < finalized. header . number {
177- let notification = l1_watcher. recv ( ) . await . unwrap ( ) ;
187+ let mut notification = l1_watcher. recv ( ) . await . unwrap ( ) ;
188+ // skip the `L1Notification::Processed` notifications
189+ if matches ! ( notification. as_ref( ) , L1Notification :: Processed ( _) ) {
190+ notification = l1_watcher. recv ( ) . await . unwrap ( ) ;
191+ }
178192 assert_eq ! ( notification. as_ref( ) , & L1Notification :: Finalized ( finalized. header. number) ) ;
179193 }
180194
181195 if latest_number == latest. header . number {
182196 continue
183197 }
184198
185- // skip the `L1Notification::Synced` notifications
186199 let mut notification = l1_watcher. recv ( ) . await . unwrap ( ) ;
200+
201+ // skip the `L1Notification::Processed` notifications
202+ if matches ! ( notification. as_ref( ) , L1Notification :: Processed ( _) ) {
203+ notification = l1_watcher. recv ( ) . await . unwrap ( ) ;
204+ }
205+
206+ // skip the `L1Notification::Synced` notifications
187207 if matches ! ( notification. as_ref( ) , L1Notification :: Synced ) {
188208 notification = l1_watcher. recv ( ) . await . unwrap ( ) ;
189209 }
0 commit comments