@@ -586,15 +586,24 @@ def test_handle_reorg_single_network(self, delta_temp_config):
586586 # Create response batches with hashes
587587 response1 = ResponseBatch .data_batch (
588588 data = batch1 ,
589- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 100 , end = 110 , hash = '0xabc' )]),
589+ metadata = BatchMetadata (
590+ ranges = [BlockRange (network = 'ethereum' , start = 100 , end = 110 , hash = '0xabc' )],
591+ ranges_complete = True , # Mark as complete so it gets tracked in state store
592+ ),
590593 )
591594 response2 = ResponseBatch .data_batch (
592595 data = batch2 ,
593- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 150 , end = 160 , hash = '0xdef' )]),
596+ metadata = BatchMetadata (
597+ ranges = [BlockRange (network = 'ethereum' , start = 150 , end = 160 , hash = '0xdef' )],
598+ ranges_complete = True , # Mark as complete so it gets tracked in state store
599+ ),
594600 )
595601 response3 = ResponseBatch .data_batch (
596602 data = batch3 ,
597- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 200 , end = 210 , hash = '0x123' )]),
603+ metadata = BatchMetadata (
604+ ranges = [BlockRange (network = 'ethereum' , start = 200 , end = 210 , hash = '0x123' )],
605+ ranges_complete = True , # Mark as complete so it gets tracked in state store
606+ ),
598607 )
599608
600609 # Load via streaming API
@@ -637,19 +646,31 @@ def test_handle_reorg_multi_network(self, delta_temp_config):
637646 # Create response batches with network-specific ranges
638647 response1 = ResponseBatch .data_batch (
639648 data = batch1 ,
640- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 100 , end = 110 , hash = '0xaaa' )]),
649+ metadata = BatchMetadata (
650+ ranges = [BlockRange (network = 'ethereum' , start = 100 , end = 110 , hash = '0xaaa' )],
651+ ranges_complete = True , # Mark as complete so it gets tracked in state store
652+ ),
641653 )
642654 response2 = ResponseBatch .data_batch (
643655 data = batch2 ,
644- metadata = BatchMetadata (ranges = [BlockRange (network = 'polygon' , start = 100 , end = 110 , hash = '0xbbb' )]),
656+ metadata = BatchMetadata (
657+ ranges = [BlockRange (network = 'polygon' , start = 100 , end = 110 , hash = '0xbbb' )],
658+ ranges_complete = True , # Mark as complete so it gets tracked in state store
659+ ),
645660 )
646661 response3 = ResponseBatch .data_batch (
647662 data = batch3 ,
648- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 150 , end = 160 , hash = '0xccc' )]),
663+ metadata = BatchMetadata (
664+ ranges = [BlockRange (network = 'ethereum' , start = 150 , end = 160 , hash = '0xccc' )],
665+ ranges_complete = True , # Mark as complete so it gets tracked in state store
666+ ),
649667 )
650668 response4 = ResponseBatch .data_batch (
651669 data = batch4 ,
652- metadata = BatchMetadata (ranges = [BlockRange (network = 'polygon' , start = 150 , end = 160 , hash = '0xddd' )]),
670+ metadata = BatchMetadata (
671+ ranges = [BlockRange (network = 'polygon' , start = 150 , end = 160 , hash = '0xddd' )],
672+ ranges_complete = True , # Mark as complete so it gets tracked in state store
673+ ),
653674 )
654675
655676 # Load via streaming API
@@ -689,15 +710,24 @@ def test_handle_reorg_overlapping_ranges(self, delta_temp_config):
689710 # Batch 3: 170-190 (after reorg, but should be deleted as 170 >= 150)
690711 response1 = ResponseBatch .data_batch (
691712 data = batch1 ,
692- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 90 , end = 110 , hash = '0xaaa' )]),
713+ metadata = BatchMetadata (
714+ ranges = [BlockRange (network = 'ethereum' , start = 90 , end = 110 , hash = '0xaaa' )],
715+ ranges_complete = True , # Mark as complete so it gets tracked in state store
716+ ),
693717 )
694718 response2 = ResponseBatch .data_batch (
695719 data = batch2 ,
696- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 140 , end = 160 , hash = '0xbbb' )]),
720+ metadata = BatchMetadata (
721+ ranges = [BlockRange (network = 'ethereum' , start = 140 , end = 160 , hash = '0xbbb' )],
722+ ranges_complete = True , # Mark as complete so it gets tracked in state store
723+ ),
697724 )
698725 response3 = ResponseBatch .data_batch (
699726 data = batch3 ,
700- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 170 , end = 190 , hash = '0xccc' )]),
727+ metadata = BatchMetadata (
728+ ranges = [BlockRange (network = 'ethereum' , start = 170 , end = 190 , hash = '0xccc' )],
729+ ranges_complete = True , # Mark as complete so it gets tracked in state store
730+ ),
701731 )
702732
703733 # Load via streaming API
@@ -733,15 +763,24 @@ def test_handle_reorg_version_history(self, delta_temp_config):
733763
734764 response1 = ResponseBatch .data_batch (
735765 data = batch1 ,
736- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 0 , end = 10 , hash = '0xaaa' )]),
766+ metadata = BatchMetadata (
767+ ranges = [BlockRange (network = 'ethereum' , start = 0 , end = 10 , hash = '0xaaa' )],
768+ ranges_complete = True , # Mark as complete so it gets tracked in state store
769+ ),
737770 )
738771 response2 = ResponseBatch .data_batch (
739772 data = batch2 ,
740- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 50 , end = 60 , hash = '0xbbb' )]),
773+ metadata = BatchMetadata (
774+ ranges = [BlockRange (network = 'ethereum' , start = 50 , end = 60 , hash = '0xbbb' )],
775+ ranges_complete = True , # Mark as complete so it gets tracked in state store
776+ ),
741777 )
742778 response3 = ResponseBatch .data_batch (
743779 data = batch3 ,
744- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 100 , end = 110 , hash = '0xccc' )]),
780+ metadata = BatchMetadata (
781+ ranges = [BlockRange (network = 'ethereum' , start = 100 , end = 110 , hash = '0xccc' )],
782+ ranges_complete = True , # Mark as complete so it gets tracked in state store
783+ ),
745784 )
746785
747786 # Load via streaming API
@@ -792,12 +831,18 @@ def test_streaming_with_reorg(self, delta_temp_config):
792831 # Create response batches using factory methods (with hashes for proper state management)
793832 response1 = ResponseBatch .data_batch (
794833 data = data1 ,
795- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 100 , end = 110 , hash = '0xabc123' )]),
834+ metadata = BatchMetadata (
835+ ranges = [BlockRange (network = 'ethereum' , start = 100 , end = 110 , hash = '0xabc123' )],
836+ ranges_complete = True , # Mark as complete so it gets tracked in state store
837+ ),
796838 )
797839
798840 response2 = ResponseBatch .data_batch (
799841 data = data2 ,
800- metadata = BatchMetadata (ranges = [BlockRange (network = 'ethereum' , start = 150 , end = 160 , hash = '0xdef456' )]),
842+ metadata = BatchMetadata (
843+ ranges = [BlockRange (network = 'ethereum' , start = 150 , end = 160 , hash = '0xdef456' )],
844+ ranges_complete = True , # Mark as complete so it gets tracked in state store
845+ ),
801846 )
802847
803848 # Simulate reorg event using factory method
0 commit comments