Skip to content

Commit

Permalink
FEAT: Add setter last finalized cross chain header handler
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmihaic committed Dec 18, 2024
1 parent fcd76c0 commit 3f96f42
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions data/block/sovereignChainHeader.go
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,23 @@ func (sch *SovereignChainHeader) GetLastFinalizedCrossChainHeaderHandler() data.
return &sch.EpochStart.LastFinalizedCrossChainHeader
}

// SetLastFinalizedCrossChainHeaderHandler sets the last finalized cross chain header handler
func (sch *SovereignChainHeader) SetLastFinalizedCrossChainHeaderHandler(crossChainData data.EpochStartChainDataHandler) error {
if sch == nil {
return data.ErrNilPointerReceiver
}

sch.EpochStart.LastFinalizedCrossChainHeader = EpochStartCrossChainData{
ShardID: crossChainData.GetShardID(),
Epoch: crossChainData.GetEpoch(),
Round: crossChainData.GetRound(),
Nonce: crossChainData.GetNonce(),
HeaderHash: crossChainData.GetHeaderHash(),
}

return nil
}

// GetShardInfoHandlers returns empty slice
func (sch *SovereignChainHeader) GetShardInfoHandlers() []data.ShardDataHandler {
if sch == nil {
Expand Down

0 comments on commit 3f96f42

Please sign in to comment.