util

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	BlocksPerMinute = uint64(10)
	BlocksPerHour   = BlocksPerMinute * 60
	BlocksPerDay    = BlocksPerHour * 24
	BlocksPerWeek   = BlocksPerDay * 7
	BlocksPerMonth  = BlocksPerDay * 30
	BlocksPerYear   = BlocksPerDay * 365
)
View Source
const (
	// https://github.com/cosmos/cosmos-sdk/pull/8629
	// https://github.com/cosmos/cosmos-sdk/blob/main/types/config.go#L218
	// CoinType defines LUNA bip44 coin type
	CoinType = uint32(330)
	// Purpose defines LUNA bip44 purpose
	Purpose = uint32(44)
)

Variables

View Source
var AddressVerifier = func(bz []byte) error {
	if n := len(bz); n != 20 {
		return fmt.Errorf("incorrect address length %d", n)
	}

	return nil
}

AddressVerifier terra address verifier

Functions

func IsPeriodLastBlock

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

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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