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 36d5c70 commit 110db4f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions synchronizer/batches_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,34 @@ func TestBatchSynchronizer_HandleMissingBatches(t *testing.T) {
})
})

t.Run("DB error while storing missing batch", 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{}{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 110db4f

Please sign in to comment.