Skip to content

Commit

Permalink
FIX: Nil NodesCoordinatorRegistryFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmihaic committed May 26, 2022
1 parent 3d8d6c3 commit ca99944
Showing 1 changed file with 40 additions and 38 deletions.
78 changes: 40 additions & 38 deletions integrationTests/testHeartbeatNode.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,25 +278,26 @@ func CreateNodesWithTestHeartbeatNode(
cache, _ := storageUnit.NewCache(cacherCfg)
for shardId, validatorList := range validatorsMap {
argumentsNodesCoordinator := nodesCoordinator.ArgNodesCoordinator{
ShardConsensusGroupSize: shardConsensusGroupSize,
MetaConsensusGroupSize: metaConsensusGroupSize,
Marshalizer: TestMarshalizer,
Hasher: TestHasher,
ShardIDAsObserver: shardId,
NbShards: uint32(numShards),
EligibleNodes: validatorsForNodesCoordinator,
SelfPublicKey: []byte(strconv.Itoa(int(shardId))),
ConsensusGroupCache: cache,
Shuffler: &shardingMocks.NodeShufflerMock{},
BootStorer: CreateMemUnit(),
WaitingNodes: make(map[uint32][]nodesCoordinator.Validator),
Epoch: 0,
EpochStartNotifier: notifier.NewEpochStartSubscriptionHandler(),
ShuffledOutHandler: &mock.ShuffledOutHandlerStub{},
WaitingListFixEnabledEpoch: 0,
ChanStopNode: endProcess.GetDummyEndProcessChannel(),
NodeTypeProvider: &nodeTypeProviderMock.NodeTypeProviderStub{},
IsFullArchive: false,
ShardConsensusGroupSize: shardConsensusGroupSize,
MetaConsensusGroupSize: metaConsensusGroupSize,
Marshalizer: TestMarshalizer,
Hasher: TestHasher,
ShardIDAsObserver: shardId,
NbShards: uint32(numShards),
EligibleNodes: validatorsForNodesCoordinator,
SelfPublicKey: []byte(strconv.Itoa(int(shardId))),
ConsensusGroupCache: cache,
Shuffler: &shardingMocks.NodeShufflerMock{},
BootStorer: CreateMemUnit(),
WaitingNodes: make(map[uint32][]nodesCoordinator.Validator),
Epoch: 0,
EpochStartNotifier: notifier.NewEpochStartSubscriptionHandler(),
ShuffledOutHandler: &mock.ShuffledOutHandlerStub{},
WaitingListFixEnabledEpoch: 0,
ChanStopNode: endProcess.GetDummyEndProcessChannel(),
NodeTypeProvider: &nodeTypeProviderMock.NodeTypeProviderStub{},
IsFullArchive: false,
NodesCoordinatorRegistryFactory: &shardingMocks.NodesCoordinatorRegistryFactoryMock{},
}
nodesCoordinatorInstance, err := nodesCoordinator.NewIndexHashedNodesCoordinator(argumentsNodesCoordinator)
log.LogIfError(err)
Expand All @@ -323,25 +324,26 @@ func CreateNodesWithTestHeartbeatNode(
}

argumentsNodesCoordinator := nodesCoordinator.ArgNodesCoordinator{
ShardConsensusGroupSize: shardConsensusGroupSize,
MetaConsensusGroupSize: metaConsensusGroupSize,
Marshalizer: TestMarshalizer,
Hasher: TestHasher,
ShardIDAsObserver: shardId,
NbShards: uint32(numShards),
EligibleNodes: validatorsForNodesCoordinator,
SelfPublicKey: []byte(strconv.Itoa(int(shardId))),
ConsensusGroupCache: cache,
Shuffler: &shardingMocks.NodeShufflerMock{},
BootStorer: CreateMemUnit(),
WaitingNodes: make(map[uint32][]nodesCoordinator.Validator),
Epoch: 0,
EpochStartNotifier: notifier.NewEpochStartSubscriptionHandler(),
ShuffledOutHandler: &mock.ShuffledOutHandlerStub{},
WaitingListFixEnabledEpoch: 0,
ChanStopNode: endProcess.GetDummyEndProcessChannel(),
NodeTypeProvider: &nodeTypeProviderMock.NodeTypeProviderStub{},
IsFullArchive: false,
ShardConsensusGroupSize: shardConsensusGroupSize,
MetaConsensusGroupSize: metaConsensusGroupSize,
Marshalizer: TestMarshalizer,
Hasher: TestHasher,
ShardIDAsObserver: shardId,
NbShards: uint32(numShards),
EligibleNodes: validatorsForNodesCoordinator,
SelfPublicKey: []byte(strconv.Itoa(int(shardId))),
ConsensusGroupCache: cache,
Shuffler: &shardingMocks.NodeShufflerMock{},
BootStorer: CreateMemUnit(),
WaitingNodes: make(map[uint32][]nodesCoordinator.Validator),
Epoch: 0,
EpochStartNotifier: notifier.NewEpochStartSubscriptionHandler(),
ShuffledOutHandler: &mock.ShuffledOutHandlerStub{},
WaitingListFixEnabledEpoch: 0,
ChanStopNode: endProcess.GetDummyEndProcessChannel(),
NodeTypeProvider: &nodeTypeProviderMock.NodeTypeProviderStub{},
IsFullArchive: false,
NodesCoordinatorRegistryFactory: &shardingMocks.NodesCoordinatorRegistryFactoryMock{},
}
nodesCoordinatorInstance, err := nodesCoordinator.NewIndexHashedNodesCoordinator(argumentsNodesCoordinator)
log.LogIfError(err)
Expand Down

0 comments on commit ca99944

Please sign in to comment.