Skip to content

Commit

Permalink
fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
sstanculeanu committed May 9, 2023
1 parent 58698a7 commit 8ace67f
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 16 deletions.
6 changes: 3 additions & 3 deletions dataRetriever/factory/containers/resolversContainer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func TestResolversContainer_IterateNilHandlerShouldNotPanic(t *testing.T) {
defer func() {
r := recover()
if r != nil {
assert.Fail(t, "should not have paniced")
assert.Fail(t, "should not have panicked")
}
}()

Expand All @@ -269,7 +269,7 @@ func TestResolversContainer_IterateNotAValidKeyShouldWorkAndNotPanic(t *testing.
defer func() {
r := recover()
if r != nil {
assert.Fail(t, "should not have paniced")
assert.Fail(t, "should not have panicked")
}
}()

Expand All @@ -292,7 +292,7 @@ func TestResolversContainer_IterateNotAValidValueShouldWorkAndNotPanic(t *testin
defer func() {
r := recover()
if r != nil {
assert.Fail(t, "should not have paniced")
assert.Fail(t, "should not have panicked")
}
}()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestCreateCurrentEpochProvider_NilCurrentEpochProvider(t *testing.T) {
assert.IsType(t, disabled.NewEpochProvider(), cnep)
}

func TestCreateCurrentEpochProvider_ArithemticEpochProvider(t *testing.T) {
func TestCreateCurrentEpochProvider_ArithmeticEpochProvider(t *testing.T) {
t.Parallel()

cnep, err := CreateCurrentEpochProvider(
Expand Down
2 changes: 1 addition & 1 deletion dataRetriever/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ type WhiteListHandler interface {
IsInterfaceNil() bool
}

// DebugHandler defines an interface for debugging the reqested-resolved data
// DebugHandler defines an interface for debugging the requested-resolved data
type DebugHandler interface {
LogRequestedData(topic string, hashes [][]byte, numReqIntra int, numReqCross int)
LogFailedToResolveData(topic string, hash []byte, err error)
Expand Down
2 changes: 1 addition & 1 deletion dataRetriever/mock/marshalizerMock.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (mm *MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error {
}

if obj == nil {
return errors.New("nil object to serilize to")
return errors.New("nil object to serialize to")
}

if buff == nil {
Expand Down
2 changes: 1 addition & 1 deletion dataRetriever/resolvers/validatorInfoResolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ func TestValidatorInfoResolver_ProcessReceivedMessage(t *testing.T) {
require.NotNil(t, err)
assert.True(t, strings.Contains(err.Error(), dataRetriever.ErrValidatorInfoNotFound.Error()))
})
t.Run("pack data in chuncks returns error", func(t *testing.T) {
t.Run("pack data in chunks returns error", func(t *testing.T) {
t.Parallel()

args := createMockArgValidatorInfoResolver()
Expand Down
4 changes: 2 additions & 2 deletions dataRetriever/shardedData/shardedData_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestShardedData_StorageEvictsData(t *testing.T) {
}

assert.Less(t, sd.ShardDataStore("1").Len(), int(defaultTestConfig.Capacity),
"Transaction pool entries excedes the maximum configured number")
"Transaction pool entries exceeds the maximum configured number")
}

func TestShardedData_NoDuplicates(t *testing.T) {
Expand Down Expand Up @@ -228,7 +228,7 @@ func TestShardedData_RegisterAddedDataHandlerShouldWork(t *testing.T) {
}
}

func TestShardedData_RegisterAddedDataHandlerReallyAddsAhandler(t *testing.T) {
func TestShardedData_RegisterAddedDataHandlerReallyAddsHandler(t *testing.T) {
t.Parallel()

f := func(key []byte, value interface{}) {
Expand Down
7 changes: 1 addition & 6 deletions dataRetriever/storageRequesters/headerRequester_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package storagerequesters

import (
"errors"
"math"
"testing"
"time"
Expand Down Expand Up @@ -140,7 +139,6 @@ func TestHeaderRequester_SetEpochHandlerShouldWork(t *testing.T) {
func TestHeaderRequester_RequestDataFromHashNotFoundNotBufferedChannelShouldErr(t *testing.T) {
t.Parallel()

expectedErr := errors.New("expected error")
newEpochCalled := false
sendCalled := false
arg := createMockHeaderRequesterArg()
Expand Down Expand Up @@ -173,7 +171,6 @@ func TestHeaderRequester_RequestDataFromHashNotFoundNotBufferedChannelShouldErr(
func TestHeaderRequester_RequestDataFromHashNotFoundShouldErr(t *testing.T) {
t.Parallel()

expectedErr := errors.New("expected error")
newEpochCalled := false
sendCalled := false
arg := createMockHeaderRequesterArg()
Expand Down Expand Up @@ -248,7 +245,6 @@ func TestHeaderRequester_RequestDataFromHashShouldWork(t *testing.T) {
func TestHeaderRequester_RequestDataFromNonceNotFoundShouldErr(t *testing.T) {
t.Parallel()

expectedErr := errors.New("expected error")
newEpochCalled := false
sendCalled := false
arg := createMockHeaderRequesterArg()
Expand Down Expand Up @@ -343,10 +339,9 @@ func TestHeaderRequester_RequestDataFromEpoch(t *testing.T) {
err := hdReq.RequestDataFromEpoch(epochIdentifier)
assert.Equal(t, core.ErrInvalidIdentifierForEpochStartBlockRequest, err)
})
t.Run("identifier not found should error should error", func(t *testing.T) {
t.Run("identifier not found should error", func(t *testing.T) {
t.Parallel()

expectedErr := errors.New("expected error")
epochIdentifier := []byte(core.EpochStartIdentifier(100))
arg := createMockHeaderRequesterArg()
arg.HdrStorage = &storageStubs.StorerStub{
Expand Down
2 changes: 1 addition & 1 deletion dataRetriever/topicSender/diffPeerListCreator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestNewDiffPeerListCreator_ShouldWork(t *testing.T) {
assert.Equal(t, excludedTopic, dplc.ExcludedPeersOnTopic())
}

func TestMakeDiffList_EmptyExcludedShoudRetAllPeersList(t *testing.T) {
func TestMakeDiffList_EmptyExcludedShouldRetAllPeersList(t *testing.T) {
t.Parallel()

allPeers := []core.PeerID{core.PeerID("peer1"), core.PeerID("peer2")}
Expand Down

0 comments on commit 8ace67f

Please sign in to comment.