Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
taratorio committed Apr 6, 2024
1 parent 73f538a commit be452b3
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions polygon/sync/block_downloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,6 @@ func TestBlockDownloaderDownloadBlocksUsingMilestones(t *testing.T) {
InsertBlocks(gomock.Any(), gomock.Any()).
DoAndReturn(test.defaultInsertBlocksMock(&blocks)).
Times(1)
test.storage.EXPECT().
Flush(gomock.Any()).
Return(nil).
Times(1)

tip, err := test.blockDownloader.DownloadBlocksUsingMilestones(context.Background(), 1)
require.NoError(t, err)
Expand Down Expand Up @@ -250,10 +246,6 @@ func TestBlockDownloaderDownloadBlocksUsingCheckpoints(t *testing.T) {
InsertBlocks(gomock.Any(), gomock.Any()).
DoAndReturn(test.defaultInsertBlocksMock(&blocks)).
Times(4)
test.storage.EXPECT().
Flush(gomock.Any()).
Return(nil).
Times(4)

tip, err := test.blockDownloader.DownloadBlocksUsingCheckpoints(context.Background(), 1)
require.NoError(t, err)
Expand Down Expand Up @@ -328,10 +320,6 @@ func TestBlockDownloaderDownloadBlocksWhenInvalidHeadersThenPenalizePeerAndReDow
DoAndReturn(test.defaultInsertBlocksMock(&blocksBatch2)).
Times(3),
)
test.storage.EXPECT().
Flush(gomock.Any()).
Return(nil).
Times(4)

_, err := test.blockDownloader.DownloadBlocksUsingCheckpoints(context.Background(), 1)
require.NoError(t, err)
Expand All @@ -358,10 +346,6 @@ func TestBlockDownloaderDownloadBlocksWhenZeroPeersTriesAgain(t *testing.T) {
InsertBlocks(gomock.Any(), gomock.Any()).
DoAndReturn(test.defaultInsertBlocksMock(&blocks)).
Times(4)
test.storage.EXPECT().
Flush(gomock.Any()).
Return(nil).
Times(4)
gomock.InOrder(
// first time, no peers at all
test.p2pService.EXPECT().
Expand Down Expand Up @@ -439,10 +423,6 @@ func TestBlockDownloaderDownloadBlocksWhenInvalidBodiesThenPenalizePeerAndReDown
DoAndReturn(test.defaultInsertBlocksMock(&blocksBatch2)).
Times(3),
)
test.storage.EXPECT().
Flush(gomock.Any()).
Return(nil).
Times(4)

_, err := test.blockDownloader.DownloadBlocksUsingCheckpoints(context.Background(), 1)
require.NoError(t, err)
Expand Down Expand Up @@ -504,10 +484,6 @@ func TestBlockDownloaderDownloadBlocksWhenMissingBodiesThenPenalizePeerAndReDown
DoAndReturn(test.defaultInsertBlocksMock(&blocksBatch2)).
Times(3),
)
test.storage.EXPECT().
Flush(gomock.Any()).
Return(nil).
Times(4)

_, err := test.blockDownloader.DownloadBlocksUsingCheckpoints(context.Background(), 1)
require.NoError(t, err)
Expand Down Expand Up @@ -546,10 +522,6 @@ func TestBlockDownloaderDownloadBlocksRespectsMaxWorkers(t *testing.T) {
DoAndReturn(test.defaultInsertBlocksMock(&blocksBatch2)).
Times(1),
)
test.storage.EXPECT().
Flush(gomock.Any()).
Return(nil).
Times(2)

// max 1 worker
// 100 peers
Expand Down

0 comments on commit be452b3

Please sign in to comment.