Skip to content

Commit

Permalink
temporary fix for incoming header subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
axenteoctavian committed May 17, 2024
1 parent 7cb41fc commit 89239d2
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 47 deletions.
7 changes: 7 additions & 0 deletions factory/mock/processComponentsStub.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/multiversx/mx-chain-go/sharding"
"github.com/multiversx/mx-chain-go/sharding/nodesCoordinator"
"github.com/multiversx/mx-chain-go/update"

vmcommon "github.com/multiversx/mx-chain-vm-common-go"
)

Expand Down Expand Up @@ -58,6 +59,7 @@ type ProcessComponentsMock struct {
ReceiptsRepositoryInternal factory.ReceiptsRepository
SentSignaturesTrackerInternal process.SentSignaturesTracker
EpochSystemSCProcessorInternal process.EpochStartSystemSCProcessor
IncomingHeaderSubscriberInternal process.IncomingHeaderSubscriber
}

// Create -
Expand Down Expand Up @@ -290,6 +292,11 @@ func (pcm *ProcessComponentsMock) EpochSystemSCProcessor() process.EpochStartSys
return pcm.EpochSystemSCProcessorInternal
}

// IncomingHeaderSubscriber -
func (pcm *ProcessComponentsMock) IncomingHeaderSubscriber() process.IncomingHeaderSubscriber {
return pcm.IncomingHeaderSubscriberInternal
}

// IsInterfaceNil -
func (pcm *ProcessComponentsMock) IsInterfaceNil() bool {
return pcm == nil
Expand Down
42 changes: 22 additions & 20 deletions integrationTests/realcomponents/processorRunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/multiversx/mx-chain-go/storage/cache"
storageFactory "github.com/multiversx/mx-chain-go/storage/factory"
"github.com/multiversx/mx-chain-go/storage/storageunit"
"github.com/multiversx/mx-chain-go/testscommon/sovereign"
"github.com/multiversx/mx-chain-go/update/trigger"

"github.com/multiversx/mx-chain-core-go/core"
Expand Down Expand Up @@ -433,26 +434,27 @@ func (pr *ProcessorRunner) createProcessComponents(tb testing.TB) {
Version: "test",
WorkingDir: pr.Config.FlagsConfig.WorkingDir,
},
SmartContractParser: smartContractParser,
GasSchedule: gasScheduleNotifier,
NodesCoordinator: pr.NodesCoordinator,
RequestedItemsHandler: requestedItemsHandler,
WhiteListHandler: whiteListRequest,
WhiteListerVerifiedTxs: whiteListerVerifiedTxs,
MaxRating: pr.Config.RatingsConfig.General.MaxRating,
SystemSCConfig: pr.Config.SystemSCConfig,
ImportStartHandler: importStartHandler,
HistoryRepo: historyRepository,
Data: pr.DataComponents,
CoreData: pr.CoreComponents,
Crypto: pr.CryptoComponents,
State: pr.StateComponents,
Network: pr.NetworkComponents,
BootstrapComponents: pr.BootstrapComponents,
StatusComponents: pr.StatusComponents,
StatusCoreComponents: pr.StatusCoreComponents,
TxExecutionOrderHandler: txExecutionOrderHandler,
RunTypeComponents: pr.RunTypeComponents,
SmartContractParser: smartContractParser,
GasSchedule: gasScheduleNotifier,
NodesCoordinator: pr.NodesCoordinator,
RequestedItemsHandler: requestedItemsHandler,
WhiteListHandler: whiteListRequest,
WhiteListerVerifiedTxs: whiteListerVerifiedTxs,
MaxRating: pr.Config.RatingsConfig.General.MaxRating,
SystemSCConfig: pr.Config.SystemSCConfig,
ImportStartHandler: importStartHandler,
HistoryRepo: historyRepository,
Data: pr.DataComponents,
CoreData: pr.CoreComponents,
Crypto: pr.CryptoComponents,
State: pr.StateComponents,
Network: pr.NetworkComponents,
BootstrapComponents: pr.BootstrapComponents,
StatusComponents: pr.StatusComponents,
StatusCoreComponents: pr.StatusCoreComponents,
TxExecutionOrderHandler: txExecutionOrderHandler,
IncomingHeaderSubscriber: &sovereign.IncomingHeaderSubscriberStub{},
RunTypeComponents: pr.RunTypeComponents,
}

processFactory, err := factoryProcessing.NewProcessComponentsFactory(argsProcess)
Expand Down
56 changes: 29 additions & 27 deletions node/nodeRunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import (
"github.com/multiversx/mx-chain-go/storage/cache"
storageFactory "github.com/multiversx/mx-chain-go/storage/factory"
"github.com/multiversx/mx-chain-go/storage/storageunit"
"github.com/multiversx/mx-chain-go/testscommon/sovereign"
trieStatistics "github.com/multiversx/mx-chain-go/trie/statistics"
"github.com/multiversx/mx-chain-go/update/trigger"

Expand Down Expand Up @@ -1237,33 +1238,34 @@ func (nr *nodeRunner) CreateManagedProcessComponents(
txExecutionOrderHandler := ordering.NewOrderedCollection()

processArgs := processComp.ProcessComponentsFactoryArgs{
Config: *configs.GeneralConfig,
EpochConfig: *configs.EpochConfig,
RoundConfig: *configs.RoundConfig,
PrefConfigs: *configs.PreferencesConfig,
ImportDBConfig: *configs.ImportDbConfig,
EconomicsConfig: *configs.EconomicsConfig,
SmartContractParser: smartContractParser,
GasSchedule: gasScheduleNotifier,
NodesCoordinator: nodesCoordinator,
Data: dataComponents,
CoreData: coreComponents,
Crypto: cryptoComponents,
State: stateComponents,
Network: networkComponents,
BootstrapComponents: bootstrapComponents,
StatusComponents: statusComponents,
StatusCoreComponents: statusCoreComponents,
RequestedItemsHandler: requestedItemsHandler,
WhiteListHandler: whiteListRequest,
WhiteListerVerifiedTxs: whiteListerVerifiedTxs,
MaxRating: configs.RatingsConfig.General.MaxRating,
SystemSCConfig: configs.SystemSCConfig,
ImportStartHandler: importStartHandler,
HistoryRepo: historyRepository,
FlagsConfig: *configs.FlagsConfig,
TxExecutionOrderHandler: txExecutionOrderHandler,
RunTypeComponents: runTypeComponents,
Config: *configs.GeneralConfig,
EpochConfig: *configs.EpochConfig,
RoundConfig: *configs.RoundConfig,
PrefConfigs: *configs.PreferencesConfig,
ImportDBConfig: *configs.ImportDbConfig,
EconomicsConfig: *configs.EconomicsConfig,
SmartContractParser: smartContractParser,
GasSchedule: gasScheduleNotifier,
NodesCoordinator: nodesCoordinator,
Data: dataComponents,
CoreData: coreComponents,
Crypto: cryptoComponents,
State: stateComponents,
Network: networkComponents,
BootstrapComponents: bootstrapComponents,
StatusComponents: statusComponents,
StatusCoreComponents: statusCoreComponents,
RequestedItemsHandler: requestedItemsHandler,
WhiteListHandler: whiteListRequest,
WhiteListerVerifiedTxs: whiteListerVerifiedTxs,
MaxRating: configs.RatingsConfig.General.MaxRating,
SystemSCConfig: configs.SystemSCConfig,
ImportStartHandler: importStartHandler,
HistoryRepo: historyRepository,
FlagsConfig: *configs.FlagsConfig,
TxExecutionOrderHandler: txExecutionOrderHandler,
RunTypeComponents: runTypeComponents,
IncomingHeaderSubscriber: &sovereign.IncomingHeaderSubscriberStub{},
}
processComponentsFactory, err := processComp.NewProcessComponentsFactory(processArgs)
if err != nil {
Expand Down

0 comments on commit 89239d2

Please sign in to comment.