@@ -6,7 +6,7 @@ use crate::subgraph::state::IndexingState;
6
6
use crate :: subgraph:: stream:: new_block_stream;
7
7
use crate :: subgraph:: SubgraphInstance ;
8
8
use atomic_refcell:: AtomicRefCell ;
9
- use graph:: blockchain:: block_stream:: { BlockStreamEvent , BlockWithTriggers } ;
9
+ use graph:: blockchain:: block_stream:: { BlockStreamEvent , BlockWithTriggers , FirehoseCursor } ;
10
10
use graph:: blockchain:: { Block , Blockchain , DataSource , TriggerFilter as _} ;
11
11
use graph:: components:: {
12
12
store:: ModificationsAndCache ,
@@ -139,7 +139,7 @@ where
139
139
& mut self ,
140
140
block_stream_cancel_handle : & CancelHandle ,
141
141
block : BlockWithTriggers < C > ,
142
- firehose_cursor : Option < String > ,
142
+ firehose_cursor : FirehoseCursor ,
143
143
) -> Result < Action , BlockProcessingError > {
144
144
let triggers = block. trigger_data ;
145
145
let block = Arc :: new ( block. block ) ;
@@ -556,13 +556,13 @@ trait StreamEventHandler<C: Blockchain> {
556
556
async fn handle_process_block (
557
557
& mut self ,
558
558
block : BlockWithTriggers < C > ,
559
- cursor : Option < String > ,
559
+ cursor : FirehoseCursor ,
560
560
cancel_handle : & CancelHandle ,
561
561
) -> Result < Action , Error > ;
562
562
async fn handle_revert (
563
563
& mut self ,
564
564
revert_to_ptr : BlockPtr ,
565
- cursor : Option < String > ,
565
+ cursor : FirehoseCursor ,
566
566
) -> Result < Action , Error > ;
567
567
async fn handle_err (
568
568
& mut self ,
@@ -580,7 +580,7 @@ where
580
580
async fn handle_process_block (
581
581
& mut self ,
582
582
block : BlockWithTriggers < C > ,
583
- cursor : Option < String > ,
583
+ cursor : FirehoseCursor ,
584
584
cancel_handle : & CancelHandle ,
585
585
) -> Result < Action , Error > {
586
586
let block_ptr = block. ptr ( ) ;
@@ -614,9 +614,7 @@ where
614
614
615
615
let start = Instant :: now ( ) ;
616
616
617
- let res = self
618
- . process_block ( & cancel_handle, block, cursor. into ( ) )
619
- . await ;
617
+ let res = self . process_block ( & cancel_handle, block, cursor) . await ;
620
618
621
619
let elapsed = start. elapsed ( ) . as_secs_f64 ( ) ;
622
620
self . metrics
@@ -780,7 +778,7 @@ where
780
778
async fn handle_revert (
781
779
& mut self ,
782
780
revert_to_ptr : BlockPtr ,
783
- cursor : Option < String > ,
781
+ cursor : FirehoseCursor ,
784
782
) -> Result < Action , Error > {
785
783
// Current deployment head in the database / WritableAgent Mutex cache.
786
784
//
@@ -797,7 +795,7 @@ where
797
795
if let Err ( e) = self
798
796
. inputs
799
797
. store
800
- . revert_block_operations ( revert_to_ptr, cursor. as_deref ( ) )
798
+ . revert_block_operations ( revert_to_ptr, cursor)
801
799
. await
802
800
{
803
801
error ! ( & self . logger, "Could not revert block. Retrying" ; "error" => %e) ;
0 commit comments