types

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const RootCodespace = "decimal"

RootCodespace is the codespace for all errors defined in the project.

Variables

View Source
var (
	ErrKeyTypeNotSupported = sdkerrors.New(RootCodespace, codeKeyTypeNotSupported, "key type 'secp256k1' not supported")
)

errors

Functions

func FindUtil

func FindUtil(group Findable, el string) int

FindUtil is a binary search funcion for types that support the Findable interface (elements must be sorted)

func FindUtilUint64

func FindUtilUint64(group FindableUint64, el uint64) int

func GetDecimalAddressFromBech32

func GetDecimalAddressFromBech32(address string) (sdk.AccAddress, error)

GetDecimalAddressFromBech32 returns the sdk.Account address of given address, while also changing bech32 human readable prefix (HRP) to the value set on the global sdk.Config (eg: `dx`). The function fails if the provided bech32 address is invalid.

func GetDecimalAddressFromHex added in v0.0.8

func GetDecimalAddressFromHex(address string) (sdk.AccAddress, error)

GetDecimalAddressFromHex returns the sdk.Account address of given address. The function fails if the provided hex address is invalid or does not start with 0x.

func GetLegacyAddressFromPubKey

func GetLegacyAddressFromPubKey(pubKeyBytes []byte) (string, error)

GetLegacyAddressFromPubKey returns wallets address in old blockchain for given public key bytes

func IsSupportedKey

func IsSupportedKey(pk cryptotypes.PubKey) bool

IsSupportedKey returns true if the pubkey type is supported by the chain.

Types

type Findable

type Findable interface {
	ElAtIndex(index int) string
	Len() int
}

Findable is an interface for iterable types that allows the FindUtil function to work

type FindableUint64

type FindableUint64 interface {
	ElAtIndex(index int) uint64
	Len() int
}

type SortedStringArray

type SortedStringArray []string

SortedStringArray is an array of strings whose sole purpose is to help with find

func (SortedStringArray) ElAtIndex

func (sa SortedStringArray) ElAtIndex(index int) string

func (SortedStringArray) Has

func (sa SortedStringArray) Has(item string) bool

func (SortedStringArray) Len

func (sa SortedStringArray) Len() int

func (SortedStringArray) Less

func (sa SortedStringArray) Less(i, j int) bool

func (SortedStringArray) Sort

Sort is a helper function to sort the set of strings in place

func (SortedStringArray) String

func (sa SortedStringArray) String() string

String is the string representation

func (SortedStringArray) Swap

func (sa SortedStringArray) Swap(i, j int)

type SortedUintArray

type SortedUintArray []uint64

func (SortedUintArray) ElAtIndex

func (sa SortedUintArray) ElAtIndex(index int) uint64

func (SortedUintArray) Find

func (sa SortedUintArray) Find(el uint64) (idx int)

func (SortedUintArray) Has

func (sa SortedUintArray) Has(el uint64) bool

func (SortedUintArray) Len

func (sa SortedUintArray) Len() int

func (SortedUintArray) Less

func (sa SortedUintArray) Less(i, j int) bool

func (SortedUintArray) Max

func (sa SortedUintArray) Max() uint64

func (SortedUintArray) Sort

func (sa SortedUintArray) Sort() SortedUintArray

Sort is a helper function to sort the set of strings in place

func (SortedUintArray) String

func (sa SortedUintArray) String() string

String is the string representation

func (SortedUintArray) Swap

func (sa SortedUintArray) Swap(i, j int)

Directories

Path Synopsis
Package bigfloat provides the implementation of a few additional operations for the standard library big.Float type.
Package bigfloat provides the implementation of a few additional operations for the standard library big.Float type.

Jump to

Keyboard shortcuts

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