Documentation ¶
Index ¶
- Constants
- Variables
- func FindUtil(group Findable, el string) int
- func FindUtilUint64(group FindableUint64, el uint64) int
- func GetDecimalAddressFromBech32(address string) (sdk.AccAddress, error)
- func GetDecimalAddressFromHex(address string) (sdk.AccAddress, error)
- func GetLegacyAddressFromPubKey(pubKeyBytes []byte) (string, error)
- func IsSupportedKey(pk cryptotypes.PubKey) bool
- type Findable
- type FindableUint64
- type SortedStringArray
- func (sa SortedStringArray) ElAtIndex(index int) string
- func (sa SortedStringArray) Has(item string) bool
- func (sa SortedStringArray) Len() int
- func (sa SortedStringArray) Less(i, j int) bool
- func (sa SortedStringArray) Sort() SortedStringArray
- func (sa SortedStringArray) String() string
- func (sa SortedStringArray) Swap(i, j int)
- type SortedUintArray
- func (sa SortedUintArray) ElAtIndex(index int) uint64
- func (sa SortedUintArray) Find(el uint64) (idx int)
- func (sa SortedUintArray) Has(el uint64) bool
- func (sa SortedUintArray) Len() int
- func (sa SortedUintArray) Less(i, j int) bool
- func (sa SortedUintArray) Max() uint64
- func (sa SortedUintArray) Sort() SortedUintArray
- func (sa SortedUintArray) String() string
- func (sa SortedUintArray) Swap(i, j int)
Constants ¶
const RootCodespace = "decimal"
RootCodespace is the codespace for all errors defined in the project.
Variables ¶
var (
ErrKeyTypeNotSupported = sdkerrors.New(RootCodespace, codeKeyTypeNotSupported, "key type 'secp256k1' not supported")
)
errors
Functions ¶
func FindUtil ¶
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 ¶
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 ¶
Findable is an interface for iterable types that allows the FindUtil function to work
type FindableUint64 ¶
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 ¶
func (sa SortedStringArray) Sort() SortedStringArray
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)