utils

package
v0.8.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccAddressFromBech32 added in v0.6.0

func AccAddressFromBech32(address string, checkHRP string) (addr sdk.AccAddress, err error)

func GatherAllKeysFromStore added in v0.9.0

func GatherAllKeysFromStore(storeObj store.KVStore) []string

func GatherValuesFromStore added in v0.9.0

func GatherValuesFromStore[T any](storeObj store.KVStore, keyStart []byte, keyEnd []byte, parseValue func([]byte) (T, error)) ([]T, error)

func GatherValuesFromStorePrefix added in v0.9.0

func GatherValuesFromStorePrefix[T any](storeObj store.KVStore, prefix []byte, parseValue func([]byte) (T, error)) ([]T, error)

func GenerateAccAddressForTest added in v0.6.6

func GenerateAccAddressForTest() sdk.AccAddress

func GenerateValAddressForTest added in v0.6.6

func GenerateValAddressForTest() sdk.ValAddress

func GetFirstValueAfterPrefixInclusive added in v0.9.0

func GetFirstValueAfterPrefixInclusive[T any](storeObj store.KVStore, keyStart []byte, parseValue func([]byte) (T, error)) (T, error)

func GetFirstValueInRange added in v0.9.0

func GetFirstValueInRange[T any](storeObj store.KVStore, keyStart []byte, keyEnd []byte, reverseIterate bool, parseValue func([]byte) (T, error)) (T, error)

func GetIterValuesWithStop added in v0.9.0

func GetIterValuesWithStop[T any](
	storeObj store.KVStore,
	keyStart []byte,
	keyEnd []byte,
	reverse bool,
	stopFn func([]byte) bool,
	parseValue func([]byte) (T, error),
) ([]T, error)

func GetValuesUntilDerivedStop added in v0.9.0

func GetValuesUntilDerivedStop[T any](storeObj store.KVStore, keyStart []byte, stopFn func([]byte) bool, parseValue func([]byte) (T, error)) ([]T, error)

func Keys added in v0.9.0

func Keys[V interface{}](in map[string]V) []string

func MaxI64

func MaxI64(in []int64) int64

func MaxU64

func MaxU64(in []uint64) uint64

func MinI64

func MinI64(in []int64) int64

func MinU64

func MinU64(in []uint64) uint64

func MustGet added in v0.9.0

func MustGet(store store.KVStore, key []byte, result proto.Message)

MustGet gets key from store by mutating result Panics on any error.

func MustGetDec added in v0.9.0

func MustGetDec(store store.KVStore, key []byte) sdk.Dec

MustGetDec gets dec value from store at key. Panics on any error.

func MustSet added in v0.9.0

func MustSet(storeObj store.KVStore, key []byte, value proto.Message)

MustSet runs store.Set(key, proto.Marshal(value)) but panics on any error.

func MustSetDec added in v0.9.0

func MustSetDec(store store.KVStore, key []byte, value sdk.Dec)

MustSetDec sets dec value to store at key. Panics on any error.

func SortSlice added in v0.9.0

func SortSlice[T constraints.Ordered](s []T)

SortSlice sorts a slice of type T elements that implement constraints.Ordered. Mutates input slice s

func ValAddressFromBech32 added in v0.6.0

func ValAddressFromBech32(address string, checkHRP string) (addr sdk.ValAddress, err error)

func ValidateProofOps added in v0.6.0

func ValidateProofOps(ctx sdk.Context, ibcKeeper *ibcKeeper.Keeper, connectionID string, chainID string, height int64, module string, key []byte, data []byte, proofOps *crypto.ProofOps) error

Types

type ContextKey added in v0.6.0

type ContextKey string

func (ContextKey) String added in v0.6.0

func (c ContextKey) String() string

Jump to

Keyboard shortcuts

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