Skip to content

Commit

Permalink
FEAT: RunTypeComponentsHolder for incoming header processor
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmihaic committed Oct 18, 2024
1 parent f37a7ef commit efcd1d5
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
package incomingHeader

import (
"github.com/multiversx/mx-chain-core-go/core/check"
"github.com/multiversx/mx-chain-go/config"
"github.com/multiversx/mx-chain-go/dataRetriever"
sovereignBlock "github.com/multiversx/mx-chain-go/dataRetriever/dataPool/sovereign"
errorsMx "github.com/multiversx/mx-chain-go/errors"
mainFactory "github.com/multiversx/mx-chain-go/factory"
"github.com/multiversx/mx-chain-go/process"
"github.com/multiversx/mx-chain-go/process/block/sovereign"

hasherFactory "github.com/multiversx/mx-chain-core-go/hashing/factory"
marshallerFactory "github.com/multiversx/mx-chain-core-go/marshal/factory"
)

// RunTypeComponentsHolder defines run type components needed to create an incoming header processor
type RunTypeComponentsHolder interface {
OutGoingOperationsPoolHandler() sovereignBlock.OutGoingOperationsPool
DataCodecHandler() sovereign.DataCodecHandler
TopicsCheckerHandler() sovereign.TopicsCheckerHandler
IsInterfaceNil() bool
}

// CreateIncomingHeaderProcessor creates the incoming header processor
func CreateIncomingHeaderProcessor(
config *config.NotifierConfig,
dataPool dataRetriever.PoolsHolder,
mainChainNotarizationStartRound uint64,
runTypeComponents mainFactory.RunTypeComponentsHolder,
) (process.IncomingHeaderSubscriber, error) {
if check.IfNil(runTypeComponents) {
return nil, errorsMx.ErrNilRunTypeComponents
}

marshaller, err := marshallerFactory.NewMarshalizer(config.WebSocketConfig.MarshallerType)
if err != nil {
return nil, err
Expand Down

0 comments on commit efcd1d5

Please sign in to comment.