Back to godoc.org

Package util

v0.3.6
Latest Go to latest
Published: Jun 11, 2020 | License: Apache-2.0 | Module: github.com/terra-project/core

Index

Package Files

Constants

const (
	BlocksPerMinute = int64(10)
	BlocksPerHour   = BlocksPerMinute * 60
	BlocksPerDay    = BlocksPerHour * 24
	BlocksPerWeek   = BlocksPerDay * 7
	BlocksPerMonth  = BlocksPerDay * 30
	BlocksPerYear   = BlocksPerDay * 365

	BlocksPerEpoch = BlocksPerWeek
)

nolint

const (
	// CoinType defines LUNA bip44 coin type
	CoinType = uint32(330)
	// FullFundraiserPath defines full fundraiser path for LUNA coin type
	FullFundraiserPath = "44'/330'/0'/0/0"
)
const (
	// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
	Bech32PrefixAccAddr = "terra"
	// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key
	Bech32PrefixAccPub = "terrapub"
	// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
	Bech32PrefixValAddr = "terravaloper"
	// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
	Bech32PrefixValPub = "terravaloperpub"
	// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
	Bech32PrefixConsAddr = "terravalcons"
	// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
	Bech32PrefixConsPub = "terravalconspub"
)

func GetEpoch

func GetEpoch(ctx sdk.Context) int64

GetEpoch returns the current epoch, starting from 0

func IsPeriodLastBlock

func IsPeriodLastBlock(ctx sdk.Context, blocksPerPeriod int64) bool

IsPeriodLastBlock returns true if we are at the last block of the period

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier