Skip to content

Commit

Permalink
fix unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
joanestebanr committed May 8, 2024
1 parent 092be70 commit 02c2787
Show file tree
Hide file tree
Showing 13 changed files with 1,291 additions and 640 deletions.
9 changes: 4 additions & 5 deletions synchronizer/l1_sync/l1_sequential_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func newL1SyncData(t *testing.T) *testL1SyncData {
ctx := context.TODO()
lastEthBlock := &entities.L1Block{
BlockNumber: 100,
HasEvents: true,
}
return &testL1SyncData{
mockBlockRetriever: mockBlock,
Expand Down Expand Up @@ -107,9 +108,7 @@ func TestSyncBlocksSequentialReorgMissingFirstBlockOnRollupResponse(t *testing.T
}, nil)
toBlock := uint64(100)
testData.mockEth.EXPECT().GetRollupInfoByBlockRange(testData.ctx, uint64(100), &toBlock).Return(nil, nil, nil)
testData.mockReorg.EXPECT().MissingBlockOnResponseRollup(testData.ctx, testData.lastEthBlock).Return(nil, nil)
resBlock, synced, err := testData.sut.SyncBlocksSequential(testData.ctx, testData.lastEthBlock)
require.NoError(t, err)
require.Equal(t, synced, true)
require.Equal(t, resBlock, testData.lastEthBlock)
//testData.mockReorg.EXPECT().MissingBlockOnResponseRollup(testData.ctx, testData.lastEthBlock).Return(nil, nil)
_, _, err := testData.sut.SyncBlocksSequential(testData.ctx, testData.lastEthBlock)
require.Error(t, err)
}
93 changes: 93 additions & 0 deletions synchronizer/l1_sync/mocks/block_points_retriever.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 89 additions & 0 deletions synchronizer/l1_sync/mocks/block_range_processor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

109 changes: 109 additions & 0 deletions synchronizer/l1_sync/mocks/etherman_interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 02c2787

Please sign in to comment.