utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 19 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccAddressFromTopic

func AccAddressFromTopic(topic common.Hash) sdk.AccAddress

func CoinsToMap

func CoinsToMap(coins ...sdk.Coin) map[string]string

func FromAnyPubKeyToConsensusAddress

func FromAnyPubKeyToConsensusAddress(protoAny *codectypes.Any, codec codec.Codec) (consAddr sdk.ConsAddress, success bool)

func FromAnyToJsonMap

func FromAnyToJsonMap(protoAny *codectypes.Any, codec codec.Codec) (map[string]any, error)

func GetEvmTransactionHashFromEvent

func GetEvmTransactionHashFromEvent(events []abci.Event) *common.Hash

func GetIncomingIBCCoin

func GetIncomingIBCCoin(srcPort, srcChannel string, dstPort, dstChannel string, denom, amt string) (sdk.Coin, error)

func IsEventTypeWithAllAttributes

func IsEventTypeWithAllAttributes(event abci.Event, eventType string, attributeKeys ...string) (bool, map[string]string)

func IsEvmEventMatch

func IsEvmEventMatch(
	topics []common.Hash, data []byte,
	wantTopicSize int,
	wantTopic0 common.Hash,
	wantTopic1MustBeAddress, wantTopic2MustBeAddress, wantTopic3MustBeAddress, wantData bool,
) bool

func IsEvmTx

func IsEvmTx(tx *tx.Tx) bool

func NormalizeAddress

func NormalizeAddress(address string) string

func NormalizeTransactionHash

func NormalizeTransactionHash(hash string, upper bool) string

NormalizeTransactionHash normalizes the transaction hash into '0xHASH' format. Contract: input hash is a valid transaction hash, with or without '0x' prefix.

func ProtoMessageName

func ProtoMessageName(msg sdk.Msg) string

func QueryContextWithHeight

func QueryContextWithHeight(height int64) context.Context

Types

This section is empty.

Jump to

Keyboard shortcuts

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