common

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MicroCTKDenom = "uctk"
	MicroUnit     = int64(1e6)

	// MaxTimestamp is max timestamp supported by Amino.
	// Dec 31, 9999 - 23:59:59 GMT
	MaxTimestamp = 253402300799
)
View Source
const (
	BlocksPerMinute = uint64(12)
	BlocksPerHour   = BlocksPerMinute * 60
	BlocksPerDay    = BlocksPerHour * 24
	BlocksPerWeek   = BlocksPerDay * 7
	BlocksPerMonth  = BlocksPerDay * 30
	BlocksPerYear   = BlocksPerDay * 365

	BlocksPerEpoch = BlocksPerWeek

	SecondsPerBlock = uint64(5)
)
View Source
const (
	// Bech32MainPrefix is the common prefix of all prefixes.
	Bech32MainPrefix = "shentu"

	// Bech32PrefixAccAddr is the prefix of account addresses.
	Bech32PrefixAccAddr = Bech32MainPrefix
	// Bech32PrefixAccPub is the prefix of account public keys.
	Bech32PrefixAccPub = Bech32MainPrefix + sdk.PrefixPublic
	// Bech32PrefixValAddr is the prefix of validator operator addresses.
	Bech32PrefixValAddr = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixOperator
	// Bech32PrefixValPub is the prefix of validator operator public keys.
	Bech32PrefixValPub = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic
	// Bech32PrefixConsAddr is the prefix of consensus node addresses.
	Bech32PrefixConsAddr = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixConsensus
	// Bech32PrefixConsPub is the prefix of consensus node public keys.
	Bech32PrefixConsPub = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic
)

Variables

This section is empty.

Functions

func DivideCoins

func DivideCoins(coins sdk.Coins, dividend int64) sdk.Coins

DivideCoins divides the coins with certain number, discarding any remainders.

func GetCoinPercentage

func GetCoinPercentage(coins sdk.Coins, percentage int64) sdk.Coins

GetCoinPercentage returns a certain percentage of coins. NOTE: The amount of coins returned will always be floored.

func PrefixToShentu added in v2.8.0

func PrefixToShentu(address string) (string, error)

PrefixToShentu convert certik prefix address to shentu prefix address

Types

This section is empty.

Jump to

Keyboard shortcuts

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