Skip to content

Commit

Permalink
Merge branch 'rc/v1.6.next1' into sandbox-queries
Browse files Browse the repository at this point in the history
  • Loading branch information
gabi-vuls authored Feb 14, 2024
2 parents 5a3ec4d + b5dcb4f commit d7339ec
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 457 deletions.
26 changes: 0 additions & 26 deletions factory/heartbeat/heartbeatV2Components.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,32 +272,6 @@ func (hcf *heartbeatV2ComponentsFactory) Create() (*heartbeatV2Components, error
return nil, err
}

argsMainCrossShardPeerTopicNotifier := monitor.ArgsCrossShardPeerTopicNotifier{
ShardCoordinator: hcf.processComponents.ShardCoordinator(),
PeerShardMapper: hcf.processComponents.PeerShardMapper(),
}
mainCrossShardPeerTopicNotifier, err := monitor.NewCrossShardPeerTopicNotifier(argsMainCrossShardPeerTopicNotifier)
if err != nil {
return nil, err
}
err = hcf.networkComponents.NetworkMessenger().AddPeerTopicNotifier(mainCrossShardPeerTopicNotifier)
if err != nil {
return nil, err
}

argsFullArchiveCrossShardPeerTopicNotifier := monitor.ArgsCrossShardPeerTopicNotifier{
ShardCoordinator: hcf.processComponents.ShardCoordinator(),
PeerShardMapper: hcf.processComponents.FullArchivePeerShardMapper(),
}
fullArchiveCrossShardPeerTopicNotifier, err := monitor.NewCrossShardPeerTopicNotifier(argsFullArchiveCrossShardPeerTopicNotifier)
if err != nil {
return nil, err
}
err = hcf.networkComponents.FullArchiveNetworkMessenger().AddPeerTopicNotifier(fullArchiveCrossShardPeerTopicNotifier)
if err != nil {
return nil, err
}

return &heartbeatV2Components{
sender: heartbeatV2Sender,
peerAuthRequestsProcessor: paRequestsProcessor,
Expand Down
21 changes: 0 additions & 21 deletions factory/heartbeat/heartbeatV2Components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
errorsMx "github.com/multiversx/mx-chain-go/errors"
heartbeatComp "github.com/multiversx/mx-chain-go/factory/heartbeat"
testsMocks "github.com/multiversx/mx-chain-go/integrationTests/mock"
"github.com/multiversx/mx-chain-go/p2p"
"github.com/multiversx/mx-chain-go/sharding"
"github.com/multiversx/mx-chain-go/storage"
"github.com/multiversx/mx-chain-go/testscommon"
Expand Down Expand Up @@ -504,26 +503,6 @@ func TestHeartbeatV2Components_Create(t *testing.T) {
assert.Nil(t, hc)
assert.Error(t, err)
})
t.Run("AddPeerTopicNotifier fails should error", func(t *testing.T) {
t.Parallel()

args := createMockHeartbeatV2ComponentsFactoryArgs()
args.NetworkComponents = &testsMocks.NetworkComponentsStub{
Messenger: &p2pmocks.MessengerStub{
AddPeerTopicNotifierCalled: func(notifier p2p.PeerTopicNotifier) error {
return expectedErr
},
},
FullArchiveNetworkMessengerField: &p2pmocks.MessengerStub{},
}
hcf, err := heartbeatComp.NewHeartbeatV2ComponentsFactory(args)
assert.NotNil(t, hcf)
assert.NoError(t, err)

hc, err := hcf.Create()
assert.Nil(t, hc)
assert.Equal(t, expectedErr, err)
})
t.Run("should work", func(t *testing.T) {
t.Parallel()

Expand Down
111 changes: 0 additions & 111 deletions heartbeat/monitor/crossShardPeerTopicNotifier.go

This file was deleted.

Loading

0 comments on commit d7339ec

Please sign in to comment.