Skip to content

Commit

Permalink
FEAT: MetaTriggerRegistryHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmihaic committed Jun 20, 2024
1 parent 22393a7 commit 92f76e5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
18 changes: 18 additions & 0 deletions data/block/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,21 @@ func (strV2 *ShardTriggerRegistryV2) SetEpochStartHeaderHandler(epochStartHeader
}
return nil
}

// GetEpochStartHeaderHandler returns the epoch start header handler
func (m *MetaTriggerRegistry) GetEpochStartHeaderHandler() data.HeaderHandler {
if m == nil {
return nil
}

return m.EpochStartMeta
}

// GetEpochStartHeaderHandler returns the epoch start header handler
func (m *SovereignShardTriggerRegistry) GetEpochStartHeaderHandler() data.HeaderHandler {
if m == nil {
return nil
}

return m.SovereignChainHeader
}
11 changes: 11 additions & 0 deletions data/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ type TriggerRegistryHandler interface {
SetEpochStartHeaderHandler(epochStartHeaderHandler HeaderHandler) error
}

// MetaTriggerRegistryHandler defines meta chain trigger registry interface
type MetaTriggerRegistryHandler interface {
GetEpoch() uint32
GetCurrentRound() uint64
GetEpochFinalityAttestingRound() uint64
GetCurrEpochStartRound() uint64
GetPrevEpochStartRound() uint64
GetEpochStartMetaHash() []byte
GetEpochStartHeaderHandler() HeaderHandler
}

// CommonHeaderHandler defines getters and setters for header data holder
type CommonHeaderHandler interface {
GetShardID() uint32
Expand Down

0 comments on commit 92f76e5

Please sign in to comment.