epoch

package
v0.0.32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEpochAt

func GetEpochAt(height int64) int64

GetEpochAt returns the epoch number where target height falls in

func GetFirstInEpoch

func GetFirstInEpoch(epoch int64) int64

GetFirstInEpoch returns the block height that is the first in a given epoch.

func GetFirstInEpochOfHeight

func GetFirstInEpochOfHeight(height int64) int64

GetFirstInEpochOfHeight returns the block height that is the first block in the epoch where the target height falls in.

func GetLastHeightInEpochOfHeight

func GetLastHeightInEpochOfHeight(height int64) int64

GetLastHeightInEpochOfHeight returns the height of the last block in the epoch where the target height falls in.

func GetLastInParentOfEpochOfHeight

func GetLastInParentOfEpochOfHeight(height int64) int64

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

func GetSeedInEpochOfHeight(height int64) int64

GetSeedInEpochOfHeight returns the block height that contains the seed for the epoch where the target height falls in

func IsBeforeEndOfEpochOfHeight

func IsBeforeEndOfEpochOfHeight(height int64) bool

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

func IsEndOfEpochOfHeight(height int64) bool

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

func IsFirstInEpoch(height int64) bool

IsFirstInEpoch checks whether a given block height is the first block in an epoch

func IsThirdToLastInEpochOfHeight

func IsThirdToLastInEpochOfHeight(height int64) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL