Skip to content

Commit

Permalink
chore: resolving nil pointer exception
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior committed Jun 8, 2021
1 parent b2ce4b6 commit cf5ae15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dot/network/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ func TestSyncQueue_ProcessBlockRequests(t *testing.T) {
req: testBlockRequestMessage,
}

time.Sleep(time.Second * 2)
require.Equal(t, 128, len(nodeA.syncQueue.responses))
time.Sleep(time.Second * 3)
require.Len(t, nodeA.syncQueue.responses, 128)
testResp := testBlockResponseMessage()
require.Equal(t, testResp.BlockData, nodeA.syncQueue.responses)
}
Expand Down
2 changes: 1 addition & 1 deletion dot/network/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewMockBlockState(n *big.Int) *MockBlockState {
func NewMockSyncer() *MockSyncer {
mocksyncer := new(MockSyncer)
mocksyncer.On("HandleBlockAnnounce", mock.AnythingOfType("*network.BlockAnnounceMessage")).Return(nil, nil)
mocksyncer.On("CreateBlockResponse", mock.AnythingOfType("*network.BlockRequestMessage")).Return(nil, nil)
mocksyncer.On("CreateBlockResponse", mock.AnythingOfType("*network.BlockRequestMessage")).Return(testBlockResponseMessage(), nil)
mocksyncer.On("ProcessJustification", mock.AnythingOfType("[]*types.BlockData")).Return(0, nil)
mocksyncer.On("ProcessBlockData", mock.AnythingOfType("[]*types.BlockData")).Return(0, nil)
mocksyncer.On("SetSyncing", mock.AnythingOfType("bool"))
Expand Down

0 comments on commit cf5ae15

Please sign in to comment.