-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6558 from multiversx/feat/sovereign-mainchain-hea…
…der-sync Feat/sovereign mainchain header sync
- Loading branch information
Showing
118 changed files
with
3,452 additions
and
583 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package common | ||
|
||
import ( | ||
"github.com/multiversx/mx-chain-core-go/data" | ||
"github.com/multiversx/mx-chain-go/config" | ||
"github.com/multiversx/mx-chain-go/factory" | ||
"github.com/multiversx/mx-chain-go/factory/runType" | ||
"github.com/multiversx/mx-chain-go/node/chainSimulator/process" | ||
sovRunType "github.com/multiversx/mx-chain-go/sovereignnode/runType" | ||
) | ||
|
||
// GetCurrentSovereignHeader returns current sovereign chain block handler from blockchain hook | ||
func GetCurrentSovereignHeader(nodeHandler process.NodeHandler) data.SovereignChainHeaderHandler { | ||
return nodeHandler.GetChainHandler().GetCurrentBlockHeader().(data.SovereignChainHeaderHandler) | ||
} | ||
|
||
// CreateSovereignRunTypeComponents will create sovereign run type components | ||
func CreateSovereignRunTypeComponents(args runType.ArgsRunTypeComponents, sovereignExtraConfig config.SovereignConfig) (factory.RunTypeComponentsHolder, error) { | ||
argsSovRunType, err := sovRunType.CreateSovereignArgsRunTypeComponents(args, sovereignExtraConfig) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
sovereignComponentsFactory, err := runType.NewSovereignRunTypeComponentsFactory(*argsSovRunType) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
managedRunTypeComponents, err := runType.NewManagedRunTypeComponents(sovereignComponentsFactory) | ||
if err != nil { | ||
return nil, err | ||
} | ||
err = managedRunTypeComponents.Create() | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return managedRunTypeComponents, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.