Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ADMINS = map[string]bool{
	"stride1k8c2m5cn322akk5wy8lpt87dd2f4yh9azg7jlh": true,
	"stride10d07y265gmmuvt4z0w9aw880jnsr700jefnezl": true,
}

Functions

func ContainsString added in v0.5.1

func ContainsString(s []string, e string) bool

check string array inclusion

func FilterDepositRecords

func FilterDepositRecords(arr []recordstypes.DepositRecord, condition func(recordstypes.DepositRecord) bool) (ret []recordstypes.DepositRecord)

func GetFromBech32

func GetFromBech32(bech32str, prefix string) ([]byte, error)

GetFromBech32 decodes a bytestring from a Bech32 encoded string.

func HostZoneUnbondingKeys added in v0.5.1

func HostZoneUnbondingKeys(m map[string]*recordstypes.HostZoneUnbonding) []string

func Int64ToCoinString

func Int64ToCoinString(amount int64, denom string) string

func Min

func Min(a int, b int) int

func StringToIntMapKeys added in v0.5.1

func StringToIntMapKeys(m map[string]int64) []string

func StringToStringMapKeys added in v0.5.1

func StringToStringMapKeys(m map[string]string) []string

func StringToStringSliceMapKeys added in v0.5.1

func StringToStringSliceMapKeys(m map[string][]string) []string

func ValidateAdminAddress

func ValidateAdminAddress(address string) error

func VerifyAddressFormat

func VerifyAddressFormat(bz []byte) error

VerifyAddressFormat verifies that the provided bytes form a valid address according to the default address rules or a custom address verifier set by GetConfig().SetAddressVerifier(). TODO make an issue to get rid of global Config ref: https://github.com/cosmos/cosmos-sdk/issues/9690

Types

type AccAddress

type AccAddress []byte

AccAddress a wrapper around bytes meant to represent an account address. When marshaled to a string or JSON, it uses Bech32.

func AccAddressFromBech32

func AccAddressFromBech32(address string, bech32prefix string) (addr AccAddress, err error)

AccAddressFromBech32 creates an AccAddress from a Bech32 string.

Jump to

Keyboard shortcuts

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