utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainAny

func ContainAny[T constraints.Ordered](src []T, trg T) bool

func DecodeToString added in v0.2.4

func DecodeToString(v string) (string, error)

func FilterNonAccountAddresses

func FilterNonAccountAddresses(addresses []string) []string

FilterNonAccountAddresses returns a slice containing only account addresses.

func GetAndPublishAccount added in v0.3.2

func GetAndPublishAccount(
	ctx context.Context,
	address string,
	height int64,
	cache AccountCache[string, int64],
	publisher AccountPublisher,
	client authtypes.QueryClient,
) error

GetAndPublishAccount retrieves the account from the given address and publishes it.

func GetGenesisAccounts

func GetGenesisAccounts(appState map[string]json.RawMessage, cdc codec.Codec) ([]types.Account, error)

GetGenesisAccounts parses the given appState and returns the genesis accounts

func NewModuleLogger added in v1.0.0

func NewModuleLogger(name string) *zerolog.Logger

func ParseCoinsFromString

func ParseCoinsFromString(value string) (types.Coins, error)

ParseCoinsFromString converts string to coin type

func TimeFromPtr added in v0.0.4

func TimeFromPtr(t *time.Time) time.Time

TimeFromPtr returns time.Time from *time.Time. If t is nil, returns time.Time{}.

Types

type AccountCache added in v0.3.2

type AccountCache[K, V comparable] interface {
	UpdateCacheValue(K, V) bool
}

type AccountPublisher added in v0.3.2

type AccountPublisher interface {
	PublishAccount(ctx context.Context, account model.Account) error
}

Jump to

Keyboard shortcuts

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