Skip to content

Commit

Permalink
fixes after self review
Browse files Browse the repository at this point in the history
  • Loading branch information
axenteoctavian committed Dec 11, 2024
1 parent 347bf60 commit 1d33d21
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion factory/mock/testdata/sovereignNodesSetupMock.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
"address": "erd10d2gufxesrp8g409tzxljlaefhs0rsgjle3l7nq38de59txxt8csj54cd3"
}
]
}
}
1 change: 1 addition & 0 deletions factory/processing/blockProcessorCreator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func Test_newBlockProcessorCreatorForMeta(t *testing.T) {
coreComponents.EnableEpochsHandler(),
)
require.Nil(t, err)

stateComponents := &mock.StateComponentsHolderStub{
PeerAccountsCalled: func() state.AccountsAdapter {
return &stateMock.AccountsStub{
Expand Down
2 changes: 1 addition & 1 deletion factory/processing/processComponents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1633,8 +1633,8 @@ func TestProcessComponentsFactory_Create(t *testing.T) {
}
return shardCoordinator.CurrentShard
}

fundGenesisWallets(t, processArgs)

pcf, _ := processComp.NewProcessComponentsFactory(processArgs)
require.NotNil(t, pcf)

Expand Down
5 changes: 5 additions & 0 deletions factory/status/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package status
import (
nodeData "github.com/multiversx/mx-chain-core-go/data"
outportCore "github.com/multiversx/mx-chain-core-go/data/outport"

"github.com/multiversx/mx-chain-go/common"
"github.com/multiversx/mx-chain-go/epochStart"
"github.com/multiversx/mx-chain-go/epochStart/notifier"
Expand Down Expand Up @@ -31,6 +32,10 @@ func CreateSaveValidatorsPubKeysEventHandler(
Epoch: currentEpoch,
})

for _, key := range validatorsPubKeys {
log.Warn("validator", "key", key, "epoch", currentEpoch, "shardID", hdr.GetShardID())
}

}, func(_ nodeData.HeaderHandler) {}, common.IndexerOrder)

return subscribeHandler
Expand Down
2 changes: 1 addition & 1 deletion factory/statusCore/statusCoreComponents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestNewStatusCoreComponentsFactory(t *testing.T) {
t.Parallel()

cfg := testscommon.GetGeneralConfig()
args := componentsMock.GetStatusCoreArgs(cfg, componentsMock.GetCoreComponents(cfg, componentsMock.GetRunTypeCoreComponents()))
args := componentsMock.GetStatusCoreArgs(cfg, componentsMock.GetCoreComponents(testscommon.GetGeneralConfig(), componentsMock.GetRunTypeCoreComponents()))
sccf, err := statusCore.NewStatusCoreComponentsFactory(args)
assert.Nil(t, err)
require.NotNil(t, sccf)
Expand Down
10 changes: 5 additions & 5 deletions factory/vm/sovereignVmContainerShardCreator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
componentsMock "github.com/multiversx/mx-chain-go/testscommon/components"
)

func createRunTypeComponents() runType.RunTypeComponentsHolder {
func createSovereignRunTypeComponents() runType.RunTypeComponentsHolder {
coreComp := componentsMock.GetSovereignCoreComponents(testscommon.GetGeneralConfig(), componentsMock.GetSovereignRunTypeCoreComponents())
cryptoComp := componentsMock.GetCryptoComponents(coreComp)

Expand All @@ -26,7 +26,7 @@ func TestNewSovereignVmContainerShardCreatorFactory(t *testing.T) {

t.Run("should work", func(t *testing.T) {
t.Parallel()
runTypeComponents := createRunTypeComponents()
runTypeComponents := createSovereignRunTypeComponents()
sovereignVmContainerShardFactory, err := vm.NewSovereignVmContainerShardFactory(runTypeComponents.VmContainerMetaFactoryCreator(), runTypeComponents.VmContainerShardFactoryCreator())
require.Nil(t, err)
require.False(t, sovereignVmContainerShardFactory.IsInterfaceNil())
Expand All @@ -35,7 +35,7 @@ func TestNewSovereignVmContainerShardCreatorFactory(t *testing.T) {
t.Run("nil vmContainerMetaFactory", func(t *testing.T) {
t.Parallel()

runTypeComponents := createRunTypeComponents()
runTypeComponents := createSovereignRunTypeComponents()
sovereignVmContainerShardFactory, err := vm.NewSovereignVmContainerShardFactory(nil, runTypeComponents.VmContainerShardFactoryCreator())
require.ErrorIs(t, err, vm.ErrNilVmContainerMetaCreator)
require.True(t, sovereignVmContainerShardFactory.IsInterfaceNil())
Expand All @@ -44,7 +44,7 @@ func TestNewSovereignVmContainerShardCreatorFactory(t *testing.T) {
t.Run("nil vmContainerShardFactory", func(t *testing.T) {
t.Parallel()

runTypeComponents := createRunTypeComponents()
runTypeComponents := createSovereignRunTypeComponents()
sovereignVmContainerShardFactory, err := vm.NewSovereignVmContainerShardFactory(runTypeComponents.VmContainerMetaFactoryCreator(), nil)
require.ErrorIs(t, err, vm.ErrNilVmContainerShardCreator)
require.True(t, sovereignVmContainerShardFactory.IsInterfaceNil())
Expand All @@ -57,7 +57,7 @@ func TestNewSovereignVmContainerShardFactory_CreateVmContainerFactoryShard(t *te
t.Skip("skipping test on arm64")
}

runTypeComponents := createRunTypeComponents()
runTypeComponents := createSovereignRunTypeComponents()
sovereignVmContainerShardFactory, err := vm.NewSovereignVmContainerShardFactory(runTypeComponents.VmContainerMetaFactoryCreator(), runTypeComponents.VmContainerShardFactoryCreator())
require.Nil(t, err)
require.False(t, sovereignVmContainerShardFactory.IsInterfaceNil())
Expand Down
3 changes: 1 addition & 2 deletions integrationTests/multiShard/hardFork/hardFork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

mxFactory "github.com/multiversx/mx-chain-go/factory"

"github.com/multiversx/mx-chain-go/common/statistics/disabled"
"github.com/multiversx/mx-chain-go/config"
"github.com/multiversx/mx-chain-go/dataRetriever"
mxFactory "github.com/multiversx/mx-chain-go/factory"
"github.com/multiversx/mx-chain-go/genesis/process"
"github.com/multiversx/mx-chain-go/integrationTests"
"github.com/multiversx/mx-chain-go/integrationTests/mock"
Expand Down
1 change: 1 addition & 0 deletions node/nodeRunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,7 @@ func (nr *nodeRunner) CreateManagedStatusComponents(
IsInImportMode: isInImportMode,
StatusCoreComponents: managedStatusCoreComponents,
CryptoComponents: cryptoComponents,
IsSovereign: false,

Check failure on line 1115 in node/nodeRunner.go

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

unknown field IsSovereign in struct literal of type "github.com/multiversx/mx-chain-go/factory/status".StatusComponentsFactoryArgs
}

statusComponentsFactory, err := statusComp.NewStatusComponentsFactory(statArgs)
Expand Down

0 comments on commit 1d33d21

Please sign in to comment.