@@ -69,6 +69,15 @@ async fn rescans_events_with_ascending_blocks() -> anyhow::Result<()> {
6969 contract. increase ( ) . send ( ) . await ?. watch ( ) . await ?;
7070 }
7171
72+ // reorg the chain
73+ let tx_block_pairs = vec ! [
74+ ( TransactionData :: JSON ( contract. increase( ) . into_transaction_request( ) ) , 0 ) ,
75+ ( TransactionData :: JSON ( contract. increase( ) . into_transaction_request( ) ) , 1 ) ,
76+ ( TransactionData :: JSON ( contract. increase( ) . into_transaction_request( ) ) , 2 ) ,
77+ ] ;
78+
79+ provider. primary ( ) . anvil_reorg ( ReorgOptions { depth : 4 , tx_block_pairs } ) . await ?;
80+
7281 // assert initial events are emitted as expected
7382 assert_event_sequence ! (
7483 stream,
@@ -80,19 +89,9 @@ async fn rescans_events_with_ascending_blocks() -> anyhow::Result<()> {
8089 CountIncreased { newCount: U256 :: from( 5 ) }
8190 ]
8291 ) ;
83- let mut stream = assert_empty ! ( stream) ;
84-
85- // reorg the chain
86- let tx_block_pairs = vec ! [
87- ( TransactionData :: JSON ( contract. increase( ) . into_transaction_request( ) ) , 0 ) ,
88- ( TransactionData :: JSON ( contract. increase( ) . into_transaction_request( ) ) , 1 ) ,
89- ( TransactionData :: JSON ( contract. increase( ) . into_transaction_request( ) ) , 2 ) ,
90- ] ;
91-
92- provider. primary ( ) . anvil_reorg ( ReorgOptions { depth : 4 , tx_block_pairs } ) . await ?;
93-
9492 // assert expected messages post-reorg
9593 assert_next ! ( stream, ScannerStatus :: ReorgDetected ) ;
94+ // assert the reorged events are emitted
9695 assert_event_sequence ! (
9796 stream,
9897 & [
0 commit comments