@@ -98,7 +98,7 @@ describe('BlockStore', () => {
9898
9999 describe ( 'addCheckpoints' , ( ) => {
100100 it ( 'returns success when adding checkpoints' , async ( ) => {
101- await expect ( blockStore . addCheckpoints ( publishedCheckpoints ) ) . resolves . toBe ( true ) ;
101+ await expect ( blockStore . addCheckpoints ( publishedCheckpoints ) ) . resolves . toEqual ( publishedCheckpoints ) ;
102102 } ) ;
103103
104104 it ( 'accepts duplicate checkpoints with matching archives and updates L1 info' , async ( ) => {
@@ -118,8 +118,10 @@ describe('BlockStore', () => {
118118 makeL1PublishedData ( 999 ) ,
119119 first3 [ 2 ] . attestations ,
120120 ) ;
121- // Also add checkpoint 4 (the next one) in the same batch
122- await blockStore . addCheckpoints ( [ cp3WithNewL1 , publishedCheckpoints [ 3 ] ] ) ;
121+ // Also add checkpoint 4 (the next one) in the same batch; only checkpoint 4 is newly inserted.
122+ await expect ( blockStore . addCheckpoints ( [ cp3WithNewL1 , publishedCheckpoints [ 3 ] ] ) ) . resolves . toEqual ( [
123+ publishedCheckpoints [ 3 ] ,
124+ ] ) ;
123125
124126 // Checkpoint 3's L1 info should be updated
125127 const afterData = await blockStore . getCheckpointData ( CheckpointNumber ( 3 ) ) ;
@@ -135,8 +137,8 @@ describe('BlockStore', () => {
135137 const first3 = publishedCheckpoints . slice ( 0 , 3 ) ;
136138 await blockStore . addCheckpoints ( first3 ) ;
137139
138- // Re-add the same 3 checkpoints — should succeed without error
139- await expect ( blockStore . addCheckpoints ( first3 ) ) . resolves . toBe ( true ) ;
140+ // Re-add the same 3 checkpoints — should succeed without inserting anything new
141+ await expect ( blockStore . addCheckpoints ( first3 ) ) . resolves . toEqual ( [ ] ) ;
140142 } ) ;
141143
142144 it ( 'throws on duplicate checkpoints with mismatching archives' , async ( ) => {
@@ -284,7 +286,7 @@ describe('BlockStore', () => {
284286 ) ;
285287 const publishedCheckpoint = makePublishedCheckpoint ( checkpoint , 10 ) ;
286288
287- await expect ( blockStore . addCheckpoints ( [ publishedCheckpoint ] ) ) . resolves . toBe ( true ) ;
289+ await expect ( blockStore . addCheckpoints ( [ publishedCheckpoint ] ) ) . resolves . toEqual ( [ publishedCheckpoint ] ) ;
288290 } ) ;
289291
290292 it ( 'throws on duplicate checkpoint with different content' , async ( ) => {
@@ -314,7 +316,7 @@ describe('BlockStore', () => {
314316 ) ;
315317 const publishedCheckpoint2 = makePublishedCheckpoint ( checkpoint2 , 10 ) ;
316318
317- await expect ( blockStore . addCheckpoints ( [ publishedCheckpoint ] ) ) . resolves . toBe ( true ) ;
319+ await expect ( blockStore . addCheckpoints ( [ publishedCheckpoint ] ) ) . resolves . toEqual ( [ publishedCheckpoint ] ) ;
318320 await expect ( blockStore . addCheckpoints ( [ publishedCheckpoint2 ] ) ) . rejects . toThrow (
319321 'already exists in store but with a different archive' ,
320322 ) ;
@@ -352,7 +354,7 @@ describe('BlockStore', () => {
352354 blocksPerCheckpoint : 2 ,
353355 } ) ;
354356
355- await expect ( blockStore . addCheckpoints ( checkpoints ) ) . resolves . toBe ( true ) ;
357+ await expect ( blockStore . addCheckpoints ( checkpoints ) ) . resolves . toEqual ( checkpoints ) ;
356358
357359 // Verify blocks have correct checkpoint assignments
358360 const block1 = await blockStore . getBlock ( { number : BlockNumber ( 1 ) } ) ;
@@ -2081,7 +2083,7 @@ describe('BlockStore', () => {
20812083 const publishedCheckpoint2 = makePublishedCheckpoint ( checkpoint2 , 10 ) ;
20822084
20832085 // This should NOT throw - addCheckpoints uses .set() which is idempotent
2084- await expect ( blockStore . addCheckpoints ( [ publishedCheckpoint2 ] ) ) . resolves . toBe ( true ) ;
2086+ await expect ( blockStore . addCheckpoints ( [ publishedCheckpoint2 ] ) ) . resolves . toEqual ( [ publishedCheckpoint2 ] ) ;
20852087
20862088 // Verify block exists and is consistent
20872089 const storedBlock = await blockStore . getBlock ( { number : BlockNumber ( 2 ) } ) ;
0 commit comments