util

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

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

nolint

View Source
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"
)
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"
)

Variables

This section is empty.

Functions

func IsPeriodLastBlock added in v0.0.7

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

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

func IsSoftforkHeight added in v0.4.1

func IsSoftforkHeight(ctx sdk.Context, version uint8) bool

IsSoftforkHeight return whether current block height is the targeted softfork height

func IsWaitingForSoftfork added in v0.4.1

func IsWaitingForSoftfork(ctx sdk.Context, version uint8) bool

IsWaitingForSoftfork returns whether current block height is bigger than reserved softfork block height

Types

type Base64Bytes added in v0.4.0

type Base64Bytes []byte

Base64Bytes is hash value of wasm bytes code

func Base64FromHexString added in v0.4.0

func Base64FromHexString(s string) (Base64Bytes, error)

Base64FromHexString convert base64 string to Base64

func (Base64Bytes) Bytes added in v0.4.0

func (h Base64Bytes) Bytes() []byte

Bytes returns the raw address bytes.

func (Base64Bytes) Empty added in v0.4.0

func (h Base64Bytes) Empty() bool

Empty check the name hash has zero length

func (Base64Bytes) Equal added in v0.4.0

func (h Base64Bytes) Equal(h2 Base64Bytes) bool

Equal does bytes equal check

func (Base64Bytes) Format added in v0.4.0

func (h Base64Bytes) Format(s fmt.State, verb rune)

Format implements the fmt.Formatter interface.

func (Base64Bytes) Marshal added in v0.4.0

func (h Base64Bytes) Marshal() ([]byte, error)

Marshal returns the raw address bytes. It is needed for protobuf compatibility.

func (Base64Bytes) MarshalJSON added in v0.4.0

func (h Base64Bytes) MarshalJSON() ([]byte, error)

MarshalJSON marshals to JSON using base64.

func (Base64Bytes) MarshalYAML added in v0.4.0

func (h Base64Bytes) MarshalYAML() (interface{}, error)

MarshalYAML marshals to YAML using base64.

func (Base64Bytes) String added in v0.4.0

func (h Base64Bytes) String() string

String implements fmt.Stringer interface

func (*Base64Bytes) Unmarshal added in v0.4.0

func (h *Base64Bytes) Unmarshal(data []byte) error

Unmarshal sets the address to the given data. It is needed for protobuf compatibility.

func (*Base64Bytes) UnmarshalJSON added in v0.4.0

func (h *Base64Bytes) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals from JSON assuming base64 encoding.

Jump to

Keyboard shortcuts

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