Skip to content

Commit

Permalink
test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rachit77 committed Nov 28, 2024
1 parent 110db4f commit fe419bf
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions synchronizer/batches_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,42 @@ func TestBatchSynchronizer_HandleMissingBatches(t *testing.T) {
})
})

t.Run("DB error while deleting missing batch entries", func(t *testing.T) {
t.Parallel()

testFn(t, testConfig{
getMissingBatchKeysArgs: []interface{}{mock.Anything, uint(100)},
getMissingBatchKeysReturns: []interface{}{
[]types.BatchKey{{
Number: 10,
Hash: txHash,
}},
nil,
},
storeOffChainDataArgs: []interface{}{mock.Anything,
[]types.OffChainData{{
Key: txHash,
Value: batchL2Data,
}},
},
storeOffChainDataReturns: []interface{}{nil},
deleteMissingBatchKeysArgs: []interface{}{mock.Anything,
[]types.BatchKey{{
Number: 10,
Hash: txHash,
}},
mock.Anything,
},
deleteMissingBatchKeysReturns: []interface{}{errors.New("error")},
getSequenceBatchArgs: []interface{}{context.Background(), uint64(10)},
getSequenceBatchReturns: []interface{}{&sequencer.SeqBatch{
Number: types.ArgUint64(10),
BatchL2Data: types.ArgBytes(batchL2Data),
}, nil},
isErrorExpected: true,
})
})

/*t.Run("Invalid tx data", func(t *testing.T) {
t.Parallel()
Expand Down

0 comments on commit fe419bf

Please sign in to comment.