utils

package
v1.7.8 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainNetChainID   = "haqq_11235"
	TestEdge1ChainID = "haqq_53211"
	TestEdge2ChainID = "haqq_54211"
	LocalNetChainID  = "haqq_121799"
	// BaseDenom defines the Haqq Network mainnet denomination
	BaseDenom = "aISLM"
)

Variables

This section is empty.

Functions

func CalculateStorageKey added in v1.7.5

func CalculateStorageKey(addr string, i int) string

calculateStorageKey -> calculates the storage key for a given address and index

func GetAccAddrFromEthAddress added in v1.7.6

func GetAccAddrFromEthAddress(addrString string) sdk.AccAddress

func GetHaqqAddressFromBech32

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

GetHaqqAddressFromBech32 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: `haqq`). The function fails if the provided bech32 address is invalid.

func IsLocalNetwork

func IsLocalNetwork(chainID string) bool

func IsMainNetwork

func IsMainNetwork(chainID string) bool

func IsSupportedKey

func IsSupportedKey(pubkey cryptotypes.PubKey) bool

IsSupportedKey returns true if the pubkey type is supported by the chain (i.e eth_secp256k1, amino multisig, ed25519). NOTE: Nested multisigs are not supported.

func IsTestEdge1Network

func IsTestEdge1Network(chainID string) bool

func IsTestEdge2Network

func IsTestEdge2Network(chainID string) bool

func Keccak256 added in v1.7.5

func Keccak256(data []byte) []byte

keccak256 -> calculates the keccak256 hash of a byte slice

func ParseHexValue added in v1.7.5

func ParseHexValue(hexStr string) *big.Int

parseHexValue -> parses a hex string into a big.Int

func Remove0xPrefix added in v1.7.5

func Remove0xPrefix(s string) string

remove0xPrefix -> removes the 0x prefix from a hex string

func UnsafeBytesToStr added in v1.7.6

func UnsafeBytesToStr(b []byte) string

UnsafeBytesToStr is meant to make a zero allocation conversion from []byte -> string to speed up operations, it is not meant to be used generally, but for a specific pattern to delete keys from a map.

func UnsafeStrToBytes added in v1.7.6

func UnsafeStrToBytes(s string) []byte

UnsafeStrToBytes uses unsafe to convert string into byte array. Returned bytes must not be altered after this function is called as it will cause a segmentation fault.

Types

This section is empty.

Jump to

Keyboard shortcuts

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