Documentation ¶
Index ¶
- func GetEpochAt(height int64) int64
- func GetFirstInEpoch(epoch int64) int64
- func GetFirstInEpochOfHeight(height int64) int64
- func GetLastHeightInEpochOfHeight(height int64) int64
- func GetLastInParentOfEpochOfHeight(height int64) int64
- func GetSeedInEpochOfHeight(height int64) int64
- func IsBeforeEndOfEpochOfHeight(height int64) bool
- func IsEndOfEpochOfHeight(height int64) bool
- func IsFirstInEpoch(height int64) bool
- func IsThirdToLastInEpochOfHeight(height int64) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEpochAt ¶
GetEpochAt returns the epoch number where target height falls in
func GetFirstInEpoch ¶
GetFirstInEpoch returns the block height that is the first in a given epoch.
func GetFirstInEpochOfHeight ¶
GetFirstInEpochOfHeight returns the block height that is the first block in the epoch where the target height falls in.
func GetLastHeightInEpochOfHeight ¶
GetLastHeightInEpochOfHeight returns the height of the last block in the epoch where the target height falls in.
func GetLastInParentOfEpochOfHeight ¶
GetLastInParentOfEpochOfHeight returns the block height that is the last block in the parent epoch of the epoch where the given block height falls in
func GetSeedInEpochOfHeight ¶
GetSeedInEpochOfHeight returns the block height that contains the seed for the epoch where the target height falls in
func IsBeforeEndOfEpochOfHeight ¶
IsBeforeEndOfEpochOfHeight checks whether the block at the given height is the block next to the last block in the end stage of an epoch. Note: The last 3 blocks of an epoch are the end stage blocks where the epoch is prepared to transition to the next. Ex: Given a chain: [1]-[2]-[3]-[4]-[5] Supposing a epoch is 5 blocks, epoch end stage starts from [3] and ends at [5]. So [4] is the block before of end of the epoch.
func IsEndOfEpochOfHeight ¶
IsEndOfEpochOfHeight checks whether the block at height is the last block of the epoch. Note: The last 3 blocks of an epoch are the end stage blocks where the epoch is prepared to transition to the next. Ex: Given a chain: [1]-[2]-[3]-[4]-[5] Supposing a epoch is 5 blocks, epoch end stage starts from [3] and ends at [5]. So [5] is the last block of the epoch.
func IsFirstInEpoch ¶
IsFirstInEpoch checks whether a given block height is the first block in an epoch
func IsThirdToLastInEpochOfHeight ¶
IsThirdToLastInEpochOfHeight checks whether the block at given height is the third to the last block its epoch.
- Ex: Given a chain: [1]-[2]-[3]-[4]-[5] Supposing a epoch is 5 blocks, epoch end stage starts from [3] and ends at [5]. So [3] is the third to the last.
Types ¶
This section is empty.